feat: integrate Spatie Media Library and update configuration
- Added Spatie Media Library dependencies to composer.json - Created media table migration for media management - Added media library configuration file - Updated Entry model to support media handling - Updated .gitignore to exclude Vite files - Added basic logging to app.js
This commit is contained in:
parent
6cf8d5dfd4
commit
5ea0ddce23
8 changed files with 874 additions and 10 deletions
|
|
@ -2,10 +2,19 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Filament\Forms\Components\RichEditor\FileAttachmentProviders\SpatieMediaLibraryFileAttachmentProvider;
|
||||
use Filament\Forms\Components\RichEditor\Models\Concerns\InteractsWithRichContent;
|
||||
use Filament\Forms\Components\RichEditor\Models\Contracts\HasRichContent;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
|
||||
class Entry extends Model implements HasRichContent, HasMedia
|
||||
|
||||
class Entry extends Model
|
||||
{
|
||||
|
||||
use InteractsWithMedia, InteractsWithRichContent;
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
|
|
@ -15,4 +24,19 @@ class Entry extends Model
|
|||
'published_at',
|
||||
'content',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Set up rich content configuration for media library integration
|
||||
*/
|
||||
public function setUpRichContent(): void
|
||||
{
|
||||
$this->registerRichContent('content')
|
||||
->fileAttachmentProvider(
|
||||
SpatieMediaLibraryFileAttachmentProvider::make()
|
||||
->collection('content-attachments')
|
||||
->preserveFilenames()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue