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.
This package provides the ability to extend several main classes with new or customized functionalities. To do that, create a new class that extends the existing class:
namespace App\Models;
use VanOns\LaravelAttachmentLibrary\Models\Attachment;
class ExtendedAttachment extends Attachment
{
// ...
}
To ensure that the new object is used throughout the package, the config should be changed to:
// config/attachment-library.php
<?php
return [
// ...
'class_mapping' => [
'attachment' => \App\Models\ExtendedAttachment::class,
// ...
],
// ...
];
How can I help you explore Laravel packages today?