Installation

Install via composer

Note

This bundle uses symfony flex recipes to install further files via composer. Please check that flex is already configured in your project as it is part of the installation.

$ composer require enhavo/media-bundle ^0.8

Add node package

Execute following command to add required node package:

$ yarn add @enhavo/media

Register form package

Add following lines to assets/enhavo/registry/form.ts

// import statement
import MediaFormRegistryPackage from "@enhavo/media/FormRegistryPackage";

// register the package
this.registerPackage(new MediaFormRegistryPackage(application));

Register encore package

Add following entrypoint to the enhavo section in webpack.config.js file.

// import
const MediaPackage = require('@enhavo/media/Encore/EncoreRegistryPackage');

// register package
.register(new MediaPackage());

Change configuration

If you want to display the media library in your application you can change your config/packages/enhavo.yaml file.

enhavo_app:
    menu:
        media_library:
            type: media_library

Migrate database

Execute following commands to upgrade your database.

$ bin/console doctrine:migrations:diff
$ bin/console doctrine:migrations:migrate

Build assets

Execute following commands to build your asset files.

$ yarn encore dev
% yarn routes:dump