kenarkose / files
Easy media management for Laravel 5
Requires
- php: >=5.4.0
- laracasts/presenter: 0.2.*
Requires (Dev)
- mockery/mockery: 0.9.*
- orchestra/testbench: ~3.1
- phpunit/phpunit: ~4.0
Suggests
- kenarkose/ownable: Allows ownership for Eloquent models on Laravel 5.
- kenarkose/transit: Easy file upload and download for Laravel 5.
- laravel/framework: This package requires Laravel 5.
README
Easy media management for Laravel 5.
Features
- Compatible with Laravel 5
- Clean API for media management
- Media substitution (for audio and video files)
- Recursive Directories for containing media
- Building blocks for easy
- Auto determination of media types and STI (Single Table Inheritance) based media models
- Customization options for file mime types and media models
- Generator for default migrations
- A phpunit test suite for easy development
Installation
Installing Files is simple.
-
Pull this package in through Composer.
{ "require": { "kenarkose/files": "~2.0" } }
-
In order to register Files Service Provider add
Kenarkose\Files\Provider\FilesServiceProvider::class
to the end ofproviders
array in yourconfig/app.php
file.'providers' => array( /* * Application Service Providers... */ App\Providers\AppServiceProvider::class, App\Providers\AuthServiceProvider::class, ... Kenarkose\Files\Provider\FilesServiceProvider::class, ),
-
In order to persist the media, directory and substitute information, you have to create migrations for models. To do so, use the following command.
php artisan files:migration
Do not forget to migrate the database when prompted to or after modifying the generated migration file.
-
Finally, you may configure the default behaviour of Files by publishing and modifying the configuration file. To do so, use the following command.
php artisan vendor:publish
Then, you will find the configuration file on the
config/files.php
path. Additional information about the options can be found in the comments of this file. All of the options in the config file are optional, and falls back to default if not specified; remove an option if you would like to use the default. -
Please check the tests and source code for further documentation.
Customization and Extension
Files plays well with its sibling packages:
Please check the package documentations to implement the functionality.
License
Files is released under MIT License.