lyre/file

File management with filament

1.2.0 2025-05-05 23:24 UTC

This package is auto-updated.

Last update: 2025-05-06 13:33:31 UTC


README

Lyre File is a Lyre addon for simple Media Management. It comes with the following predefined models to help you manage your media content:

  • File - This defines the actual media file
  • Attachment - This is a morph model defining your relationships to your media files

Installation

composer require lyre/file

Publish Assets

php artisan vendor:publish --provider="Lyre\File\Providers\LyreFileServiceProvider"

After installation, add the HasFile trait to all the relevant models:

use Lyre\File\Concerns\HasFile;

use HasFile;

Dependencies

Lyre Content depends on Lyre and Laravel Filament. To complete installation, especially if your require the functionalities from Laravel Filament, follow these additional commands:

php artisan filament:install --panels

To create an admin user:

php artisan make:filament-user

Discover Content Filament Resources

To Discover Lyre File Filament Resources on your Filament dashboard, add the LyreFileFilamentPlugin to your Filament panel like so:

use Lyre\File\Filament\Plugins\LyreFileFilamentPlugin;

$panel->plugins([
    new LyreFileFilamentPlugin(),
]);

SelectFromGallery Custom Field

Lyre File comes with a custom field to select files from gallery. You may define whether or not your model has multiple files. By default, your model will only have one file.

use Lyre\File\Filament\Forms\Components\SelectFromGallery;

SelectFromGallery::make('files')->label('Featured Images')->multiple()