Rich editor and spatie media library

In the docs for the rich text editor in V4 - https://filamentphp.com/docs/4.x/forms/rich-editor#uploading-images-to-the-editor
  • you can find:
Filament also supports spatie/laravel-medialibrary for storing rich editor file attachments. See our plugin documentation for more information.

But there is no further documentation for this in the corresponding page (https://filamentphp.com/plugins/filament-spatie-media-library#using-media-library-for-rich-editor-file-attachments). Is this a known issue or am I just stupid/blind?
Filament
Filament support for Spatie's Laravel Media Library package.
Solution
@awcodes Well I tried this now again with the current documentation provided under https://filamentphp.com/plugins/filament-spatie-media-library#using-media-library-for-rich-editor-file-attachments

I copy pasted the code, just renamed the class:

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;

class Page extends Model implements HasRichContent
{
    use InteractsWithRichContent;

    public function setUpRichContent(): void
    {
        $this->registerRichContent('content')
            ->fileAttachmentsProvider(SpatieMediaLibraryFileAttachmentProvider::make());
    }
}


and now i get:

Call to undefined method Filament\Forms\Components\RichEditor\RichContentAttribute::fileAttachmentsProvider()


I have no idea whats wrong?
Was this page helpful?