How do I create a custom Table Action
Hi guys,
I have a resource let's title it StorefrontResource. I created a custom page based on this resource called ManageWorkers. It allows me to add members to the store.
I registered the page in getPages() of the warehouse resource:
On the default list view of the StorefrontResource, how can I attach an action titled 'Manage' on the table so that when clicking it - it'll bring me to the manage workers page of the Storefront record?
Storefront Resource
-->Actions/ManageAction.php
-->Pages/...ManageWorkers.php
--StorefrontResource.php
I don't want to add code in the redirect within the resource file, but rather I'd like to have a seperate action file. Is there an artisan command for creating a table action? What is the proper convention to reference the route? I'm unsure what to override in the Manage Action class. Any pointers?
Solution:Jump to solution
I got it working by doing this - sure it works but is this the correct way?
```php
public static function make($name = 'manage'): static
{...
1 Reply
Solution
I got it working by doing this - sure it works but is this the correct way?
Update: Minor refactor or route: