ashleydawson/doctrine-gaufrette-storable-bundle
Pros:
UploadedFileTrait, promoting DRY principles.file type fields.Cons:
Laravel Compatibility:
saving, saved, deleting, deleted).EventDispatcher with Laravel’s Events system.request()->file()) and storage systems (e.g., Storage facade) may obviate the need for this bundle.Workarounds:
High:
Storage system or packages like spatie/laravel-medialibrary offer modern, maintained solutions.Mitigation:
hasFile() in Eloquent, spatie/laravel-medialibrary).Why Gaufrette?
Storage facade sufficient?Laravel Alignment
Maintenance
spatie/laravel-medialibrary)?Performance
Security
Current Stack:
Laravel Stack:
EventDispatcher.Compatibility Matrix:
| Feature | Symfony 2.3 | Laravel (Eloquent) |
|---|---|---|
| Doctrine ORM | ✅ Native | ❌ Incompatible |
| Gaufrette | ✅ Native | ⚠️ Standalone |
| Symfony Events | ✅ Native | ⚠️ Laravel Events |
| Symfony Forms | ✅ Native | ❌ Alternative |
| File Upload Handling | ✅ Trait | ⚠️ Custom Trait |
EventDispatcher, Form) with Laravel equivalents.UploadedFileTrait with an Eloquent observer/trait.Events system (e.g., FilePreWrite, FilePostDelete).Request object or Livewire for file uploads.laravelcollective/html.Pros: Reuses existing bundle logic. Cons: High maintenance burden; likely to diverge from upstream.
knplabs/gaufrette).config/filesystems.php.StorableFile) with methods for:
uploadFile(): Handles file storage to Gaufrette.deleteFile(): Removes file from Gaufrette.FileStored, FileDeleted) for custom logic.request()->file() and manually bind to the trait.Pros: Leverages Gaufrette without bundle bloat; lower risk. Cons: More manual work; no built-in form/file handling.
spatie/laravel-medialibrary:
Storage facade with adapters (no Gaufrette needed).use Illuminate\Support\Facades\Storage;
$path = $request->file('file')->store('uploads');
$model->file_path = $path;
Pros: Actively maintained; zero integration risk. Cons: May lack specific features of the original bundle (e.g., Gaufrette’s multi-adapter flexibility).
spatie/laravel-medialibrary).How can I help you explore Laravel packages today?