© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•7mo ago•
4 replies
bernhard

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?
Rich editor - Forms - Filament
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
Spatie Media Library by Filament - Filament
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());
    }
}
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()
Call to undefined method Filament\Forms\Components\RichEditor\RichContentAttribute::fileAttachmentsProvider()


I have no idea whats wrong?
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Rich editor custom block and spatie media library
FilamentFFilament / ❓┊help
5mo ago
Rich Editor + Spatie?
FilamentFFilament / ❓┊help
2y ago
Spatie Media Library
FilamentFFilament / ❓┊help
10mo ago
Spatie Media Library
FilamentFFilament / ❓┊help
14mo ago