FilamentF
Filament13mo ago
tesse05

open table record as modal from script?

I have a Resource table. When no 'edit page' is defined, when clicking the table row it opens as a modal.

In a mail, I send the url to that resource with an id like this:
ConversationResource::getUrl() . '?record=' . $conversation->id

And then, in the AppServiceProvider I do:
php       if (request()->has('record')) {
            $recordId = request()->get('record');

            Filament::registerRenderHook('body.start', fn() => new HtmlString("
                <script>
                document.addEventListener('livewire:load', function () {
                    Livewire.emit('openModal', 'filament.resources.conversations.view', { record: '{$recordId}' });
                });
                </script>
            "));
        }


the idea is to fake click the table record row which has same $recordId
Was this page helpful?