djvue / d-media-bundle
Symfony bundle for d-media package
Installs: 161
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.0
- ext-mbstring: *
- league/flysystem-bundle: ^2.0|^3.0
- phpunit/phpunit: ^9.5
- symfony/config: ^5.2|^6.0
- symfony/dependency-injection: ^5.2|^6.0
- symfony/expression-language: ^5.2|^6.0
- symfony/filesystem: ^5.2|^6.0
- symfony/framework-bundle: ^5.2|^6.0
- symfony/http-kernel: ^5.2|^6.0
- symfony/mime: ^5.2|^6.0
- symfony/orm-pack: ^2.1
- symfony/routing: ^5.2|^6.0
- symfony/security-bundle: ^5.2|^6.0
- symfony/serializer: ^5.2|^6.0
- symfony/translation: ^5.2|^6.0
- symfony/yaml: ^5.2|^6.0
Requires (Dev)
- ext-gd: *
- doctrine/doctrine-fixtures-bundle: ^3.4
- fakerphp/faker: ^1.13
- jetbrains/phpstorm-attributes: ^1.0
- liip/test-fixtures-bundle: ^1.0.0
- psalm/plugin-symfony: ^2.1
- symfony/browser-kit: ^5.2
- symfony/css-selector: ^5.2
- symfony/maker-bundle: ^1.29
- symfony/phpunit-bridge: ^5.2
- vimeo/psalm: ^4.4
README
Introduction
Symfony D-Media Bundle is a package that provides JSON REST HTTP API for frontend media manager library and services to use Medias on backend.
Frontend Package: vue-d-media
Usage example: symfony-d-media-bundle-example
Usage example demo: demo
Installation
Install with composer
composer require djvue/d-media-bundle
Requires PHP >=8.0 and Symfony >=5.2
You may also need to install frontend components. See instruction in frontend repository vue-d-media.
Getting started
- Add bundle
config/bundles.php
return [ ..., Djvue\DMediaBundle\DMediaBundle::class => ['all' => true], ];
- Import routes
config/routes.yaml
media: resource: '@DMediaBundle/Resources/config/routes/media.yaml' prefix: '/api/media' #your prefix equal to frontend library api.config.prefix trailing_slash_on_root: false name_prefix: board_media_
- Configure (optional)
config/packages/d_media.yaml
d_media: filterable_entities: - workspace storage: public_url: /storage/medias directory: /uploads library: image_extensions: png, jpg, jpeg, webp
Help services
SomeClass.php
public function __construct( private MediaService $mediaService, private MediaEntityService $mediaEntityService, ) { }
Security
Bundle controller uses symfony/security. To control access add voters: MediaVoter and MediaGetListVoter.
See example in symfony example repository symfony-d-media-bundle-example