registerRichContent('content') ->fileAttachmentProvider( SpatieMediaLibraryFileAttachmentProvider::make() ->collection('content-attachments') ->preserveFilenames() ); } protected static function boot() { parent::boot(); static::creating(function ($entry) { if (empty($entry->slug)) { $entry->slug = Str::slug($entry->title); } }); } public function category(): BelongsTo { return $this->belongsTo(Category::class); } }