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>
"));
}
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
3 Replies
tesse05
tesse05OP2w ago
up is this possible? @toeknee
toeknee
toeknee2w ago
please read the #✅┊rules and do not tag without asking. See the discord chats I have seen someone doing this before with dispatch I beleive.
tesse05
tesse05OP2w ago
lol, I haven't seen any issue before... its not a "Normal" modal😅
Want results from more Discord servers?
Add your server