Run action automatically

Hi, is it possible to run an action when the table gets loaded initially? Like a wire:init() in the view? Thank you!
3 Replies
Patrick Boivin
Is this a List page or a custom component?
Prodex
ProdexOP2y ago
It’s a list page
Patrick Boivin
I think you can piggy back on the existing wire:init attribute... On the resource table, add ->deferLoading(), then override the loadTable() method on your List page :
public function loadTable(): void
{
$this->isTableLoaded = true;

// custom action
}
public function loadTable(): void
{
$this->isTableLoaded = true;

// custom action
}
Want results from more Discord servers?
Add your server