Skip to content

ElegantEngineeringTech/laravel-media

Repository files navigation

A flexible media library for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provide an extremly flexible media library, allowing you to store any files with their conversions (nested conversions are supported). It is designed to be usable with local upload/conversions and with cloud upload/conversions solutions like Bunny.net, AWS MediaConvert, Transloadit, ...

It takes its inspiration from the wonderful spatie/laravel-media-library package (check spatie packages, they are really great),but it's not a fork. The migration from spatie/laravel-media-library is possible but not that easy if you want to keep your conversions files.

Installation

You can install the package via composer:

composer require finller/laravel-media

You can publish and run the migrations with:

php artisan vendor:publish --tag="laravel-media-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="laravel-media-config"

This is the contents of the published config file:

use Finller\Media\Models\Media;

return [
    /**
     * The media model
     */
    'model' => Media::class,

    /**
     * The default disk used to store files
     */
    'disk' => env('MEDIA_DISK', env('FILESYSTEM_DISK', 'local')),

    /**
     * The default collection name
     */
    'default_collection_name' => 'default',
];

Optionally, you can publish the views using

php artisan vendor:publish --tag="laravel-media-views"

Usage

$Media = new Finller\Media();
echo $Media->echoPhrase('Hello, Finller!');

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.