dejwcake / craftable-media
Associate files with Eloquent models
0.9.0
2023-05-06 23:58 UTC
Requires
- php: ^8.1
- illuminate/support: ^10.0
- spatie/laravel-medialibrary: ^10.0
Requires (Dev)
- orchestra/testbench: ~8.5
- phpunit/phpunit: ^10.1
This package is auto-updated.
Last update: 2024-11-09 22:12:57 UTC
README
This packages adds an ability to assign a media to your eloquent models. It uses Spatie's spatie/laravel-medialibrary
, but it goes a bit further:
- Collections definition - inspired by the conversions definition, we have created Media Collections definition via similar fluent API
- Auto-Process - saving the eloquent model automatically processes and attaches media collections from the request
- Authorization - controls, who has the permission to attach specific medium to specific model
- Private access - controls, who has the permission to view specific medium
You can find full documentation at https://docs.getcraftable.com/#/media.
Run tests
To run tests use this docker environment.
docker-compose run -it test vendor/bin/phpunit
To switch between postgresql and mariadb change in docker-compose.yml
DB_CONNECTION environmental variable:
- DB_CONNECTION: pgsql
+ DB_CONNECTION: mysql