Render Livewire component from database

What seems to be the problem: I tried to save livewire component to database and load it as a page content but the problem is i can’t render livewire when i read it from database

i have a table : pages

page has a content field and i need to save @livewire(‘content-form’) to database and then render it in blade something like this {!! $content!!}

Steps to Reproduce:

Are you using the latest version of Livewire:yes

Do you have any screenshots or code examples:

Hey, @ehsantalkhouncheh

You can’t save a blade directive inside the database and render it after that.

You can save the name of the component and after that call it like so:

@livewire($content)

Thank you @skywalker for quick reply the problem is, livewire component is just a part of page content actually i created a page builder and i save html structure as a content for each page which is contain a livewire component (i created all forms via livewire in my project) so i need a good way to render html structure in my blade page actually right now i use Fille::put for it which is not too bad but im not pretty sure if it’s good idea or not, anyway thanks a lot

The problem begins when it has properties.
I’m using this

$contentBlock = Livewire::mount($component, $properties);

And then this

{!! Blade::compileString($contentBlock) !!}

I’m not sure if there is a better way to do this.