How to edit record using modal on the custom page?

Hello, I have a TaskResource with a custom page inside that called ScheduleTask.
// TaskResource.php
public static function getPages(): array
{
    return [
        'index' => Pages\ScheduleTask::route('/schedule'),
    ];
}

Currently I can trigger a New Task Modal using getActions() function in the ScheduleTask page.
protected function getActions(): array
{
    return [
        Action::make('new_task')
            ->action(function (array $data): void {
                ...
            })
            ->form([
                ...
            ]),
    ];
}

how can I trigger the edit modal with the form filled with the selected task when I click the individual task?
Screenshot_2023-04-19_at_12.33.49.png
Screenshot_2023-04-19_at_12.45.42.png
Was this page helpful?