How to open a custom page from a custom table action?

I have a Report page that I want to open by clicking on a custom action
Action::make('report')
->action(fn(Device $record) => self::report($record)),
Action::make('report')
->action(fn(Device $record) => self::report($record)),
2 Replies
krekas
krekas15mo ago
If it's a link instead of action use url
vilerium
vileriumOP15mo ago
I want it to be a form to report a device is out of service, I was thinking about making it an action so that when clicked it changes the device status and opens the form page to create a ticket
public static function report(Device $record) {
dd(DeviceResource::getUrl('report', ['record' => $record]));

}
public static function report(Device $record) {
dd(DeviceResource::getUrl('report', ['record' => $record]));

}
this gives the correct url but idk how to go to the page This worked:
Action::make('report')->link()->url(function (Device $device) {
return DeviceResource::getUrl('report', ['record' => $device]);
})
Action::make('report')->link()->url(function (Device $device) {
return DeviceResource::getUrl('report', ['record' => $device]);
})
Want results from more Discord servers?
Add your server