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.
Strengths:
hasMany or morphToMany). This aligns well with Laravel’s conventions and reduces boilerplate for file management.Weaknesses:
public disk, which may not suit applications requiring S3, FTP, or custom storage backends without additional configuration.Key Questions:
Pros:
attachment-library:install for setup, reducing manual configuration steps.AttachmentManager facade for common operations (upload, move, delete), abstracting complexity.<x-laravel-attachment-library-image>) for easy frontend integration.Attachment, FileNamer) via configuration, enabling tailored behavior.Cons:
attachments, directories), which may conflict with existing schemas or require schema migrations.Technical Risk:
Ideal For:
Less Ideal For:
Assessment Phase:
Preparation:
composer.json).filesystems.php (e.g., ATTACHMENTS_DISK=s3).composer require spatie/laravel-glide) and configure glide.php.Integration:
composer require van-ons/laravel-attachment-library and php artisan attachment-library:install.HasAttachments trait to relevant Eloquent models.attachments and directories tables.<x-laravel-attachment-library-image>).AttachmentManager facade.Testing:
Deployment:
composer.json for exact requirements).public disk.How can I help you explore Laravel packages today?