Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lourbert's avatar

Filament RichEditor default value not working

RichEditor::make('content') ->default('We hope this email finds you well')

0 likes
6 replies
prasadchinwal5's avatar
Level 35

Hey @lourbert it does work. Can you provide more context? Is this happening on edit or create page?

Forms\Components\RichEditor::make('description')
->default('This is a test default value!')
->columnSpanFull(),
2 likes
ali-webdev's avatar

@prasadchinwal5 @LaryAI I am also facing somehow a similar issue regarding the rich editor features not showing properly, blockquote, code block, bullet lists, and numbered lists are not showing in the front-end post as they should be! In the browser's Elements section, I can see the tags blockquote, etc used in the HTML code but when I see them in the Blog post they are like plain simple text there are no blockquote, lists, etc... Only Bold, Italic, image embed, heading and links are working, I have also run this command but nothing happens, php artisan vendor:publish --tag=filament-assets --force

Now I have deployed my website to production, but the features are still not working....??

I even added all toolbar Buttons to the RichEditor body in the Post Resource File, But the output is not what I set in the blog post in the Admin Panel!!?

Here is my show.blade.php file code in resources/views/posts See if I have made any mistake in the below files, I am new to the development field, and guide me, please!

        <div
            class="article-actions-bar my-6 flex text-sm items-center justify-between border-t border-b border-gray-300 dark:border-slate-500 py-4 px-2">
            <div class="flex items-center">
                <livewire:like-button :key="'like-' . $post->id" :$post />
            </div>
            <div>
                <div class="flex items-center">
                    {{-- <button>
                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 text-gray-500 hover:text-gray-800">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
                    </svg>
                </button> --}}
                </div>
            </div>
        </div>

        <div class="article-content py-3 text-gray-800 dark:text-slate-200 text-lg text-justify max-w-full">
            {!! $post->body !!}
        </div>

        <div class="flex items-center space-x-4 mt-10">
            @foreach ($post->categories as $category)
                <x-posts.category-badge :category="$category" />
            @endforeach
        </div>

        <livewire:post-comments :key="'comments' . $post->id" :$post />
    </article>
@else
    <div class="font-black text-center mt-32 mb-10 mx-auto h-screen">
        <p class="text-gray-600 dark:text-slate-400 tracking-widest mb-2 text-lg">Please login to view this post.</p>
        <a href="{{ route('login') }}" class="text-emerald-500 hover:underline tracking-widest text-xl">Login</a>
    </div>
@endauth

Post Resource File Code Here Below Note: I have skip some code from this file so to only focus on the necessary part!

prasadchinwal5's avatar

@ali-webdev Your issue might be completely different. Which laravel and filament version are you using?

Try adding the code below to your AppServiceProvider file's boot method.

use Filament\Forms\Components\RichEditor;

RichEditor::configureUsing(function ($editor) {
            $editor->toolbarButtons([
                'attachFiles',
                'blockquote',
                'bold',
                'bulletList',
                'codeBlock',
                'h2',
                'h3',
                'html',
                'italic',
                'link',
                'orderedList',
                'redo',
                'strike',
                'underline',
                'undo',
            ]);

            $editor->disableToolbarButtons([
                //'blockquote',
                //'strike',
            ]);
        });

P.S. Remember to clear cache.

ali-webdev's avatar

@prasadchinwal5 Thank you for your reply!

"laravel/framework": "^10.10",
"filament/filament": "3.2",
  "php": "^8.1",

I add your code in the AppServiceProvider files's boot method in the local development project to test and check it but nothing changes! Below is my showpost blade file code, see if there is a mistake in it regarding parsing Html...

But before this, I am facing one error in the same project in production mode, I cannot access my blogposts and users pages except "the dashboard" in the filament admin panel, everytime It says 500 server error when I change "app_debug" to "true" this error appears Error in filament admin panel: "Error PHP 8.2.21 10.48.16 Class "NumberFormatter" not found"

Even I enabled the "ini extension" in the c-panel and also added it manually in the c-panel PHP INI EDITOR file here see it below extension=php_intl.dll

I solved this error when I deployed this project at the very first time, at that time only I enabled the extension in c-panel, but after some days when I wanted to post some blog posts, I could not access the pages! I do not know how to solve it! I do search it here and there some answers suggest that do add ini extension in the server by contacting the administrator or hosting provider is it the solution to this?

Here below is my show post blade file code, see if there is a mistake in it

        <div
            class="article-actions-bar my-6 flex text-sm items-center justify-between border-t border-b border-gray-300 dark:border-slate-500 py-4 px-2">
            <div class="flex items-center">
                <livewire:like-button :key="'like-' . $post->id" :$post />
            </div>
            <div>
                <div class="flex items-center">
                    {{-- <button>
                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 text-gray-500 hover:text-gray-800">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
                    </svg>
                </button> --}}
                </div>
            </div>
        </div>

        <div class="article-content py-3 text-gray-800 dark:text-slate-200 text-lg text-justify max-w-full">
            {!! $post->body !!}
        </div>

        <div class="flex items-center space-x-4 mt-10">
            @foreach ($post->categories as $category)
                <x-posts.category-badge :category="$category" />
            @endforeach
        </div>

        <livewire:post-comments :key="'comments' . $post->id" :$post />
    </article>
@else
    <div class="font-black text-center mt-32 mb-10 mx-auto h-screen">
        <p class="text-gray-600 dark:text-slate-400 tracking-widest mb-2 text-lg">Please login to view this post.</p>
        <a href="{{ route('login') }}" class="text-emerald-500 hover:underline tracking-widest text-xl">Login</a>
    </div>
@endauth
prasadchinwal5's avatar

@ali-webdev I will need more information on the error. Could you try running composer update on the production server? It looks like for some reason the class couldn't be found.

Also can you point me to where you are using the class?

ali-webdev's avatar

@prasadchinwal5 Thanks for your reply! The class error was resolved by contacting the hosting provider.

But now the only problem is the rich editor features that are not working somehow As I use your given code also~!?

Please or to participate in this conversation.