Show a page of a resource in a custom filament page
I have a custom filament page and onclick of a button I want to open the edit page of a filament resource within a modal. Please guide me to some resources #page
2 Replies
I don't think it is supported by filament rn, but for a workaround you can just put an iframe with the resource page url in it inside the modal, and to and iframe maybe a custom field in the modal form
Thanks for your answer. How can I open a modal with the view file containing the iframe on the click of a button?
I have tried your answer and found a way. Made a method on the page like :
public function openModal($record): void
{
$this->url = XResource::getUrl('edit', ['record' => $record]);
$this->dispatch('open-modal', id: 'edit-record');
}... In the view: <x-filament::modal id="edit-record" slide-over width="6xl">
<iframe wire:key="$url" loading="lazy" src="{{ $url }}" class="h-full"></iframe>
</x-filament::modal>
The only downside is that it also shows the components like sidebar and topbar in the modal