van-ons/laravel-attachment-library
Attach files to Laravel Eloquent models with a simple HasAttachments trait and Attachment model. Includes installer command for migrations/assets and an attachments relationship to link existing uploads to any model.
To get started with the Laravel Attachment Library, you will need to follow a few simple steps. This guide will walk you through the process of installing the package and setting it up in your Laravel application.
First, you need to add the package to your project using Composer. Open your terminal and run the following command:
$ composer require van-ons/laravel-attachment-library
After the package has been added to your project, you need to run the installation command. This command will publish the necessary configuration files and set up the package in your Laravel application.
Run the following Artisan command:
$ php artisan attachment-library:install
By default, this package uses the public disk defined in filesystems.php. This can be overridden by adding the following
to the project's .env file:
[!NOTE] It is advised to use a disk without any other files. This prevents files from being present without being visible in the file manager.
ATTACHMENTS_DISK=disk_name_here
The glide.php and attachment-library.php files contain more configuration options.
How can I help you explore Laravel packages today?