F
Filament2y 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
Include the livewire component in the modal with a custom Blade view
Abi
AbiOP2y 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
Abi2y 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]))

Did you find this page helpful?