F
Filament17mo ago
Abi

How to trigger a livewire component on table action

When using table actions, is there a way to trigger a Livewire component to load on a modal or a slideover?
Solution:
nvm, figured it out
->modalContent(fn(Subscription $subscription) => view('app.purchases.view-license', ['license' => $subscription->license]))
->modalContent(fn(Subscription $subscription) => view('app.purchases.view-license', ['license' => $subscription->license]))
...
Jump to solution
4 Replies
Patrick Boivin
Patrick Boivin17mo ago
Include the livewire component in the modal with a custom Blade view
Abi
AbiOP17mo ago
ok, if I have a custom blade view, how do I pass the data to the view? I tried this
->modalContent(view('app.purchases.view-license', [
'license' => function (Subscription $subscription) {
ray($subscription->license);
return $subscription->license;
}
]))
->modalContent(view('app.purchases.view-license', [
'license' => function (Subscription $subscription) {
ray($subscription->license);
return $subscription->license;
}
]))
but the data doesn't seem to get transfered to the view
Solution
Abi
Abi17mo ago
nvm, figured it out
->modalContent(fn(Subscription $subscription) => view('app.purchases.view-license', ['license' => $subscription->license]))
->modalContent(fn(Subscription $subscription) => view('app.purchases.view-license', ['license' => $subscription->license]))
Want results from more Discord servers?
Add your server