Modal form for url action on panel

Is there any way I could open a modal before opening a url from an action? I want to open a custom form, and then use data from the form as a parameter on the url. This doesn't work at all, the url is simply opened. I would like to replace "cash" in the url with the value selected in the form.
Action::make('tarriff_schedules')
->label('Tarriff Schedules')
->icon('heroicon-s-clipboard-list')
->form([
Select::make('Schedule')
->options(function () {
$options = ['Cash' => 'cash'];
$schedules = config('labman.tarriff_schedules');
foreach ($schedules as $schedule) {
$options[$schedule] = $schedule;
}
return $options;
})
])
->url(function () {
return route('tarriff-schedules', 'cash');
},true)
Action::make('tarriff_schedules')
->label('Tarriff Schedules')
->icon('heroicon-s-clipboard-list')
->form([
Select::make('Schedule')
->options(function () {
$options = ['Cash' => 'cash'];
$schedules = config('labman.tarriff_schedules');
foreach ($schedules as $schedule) {
$options[$schedule] = $schedule;
}
return $options;
})
])
->url(function () {
return route('tarriff-schedules', 'cash');
},true)
2 Replies
WiseWill
WiseWillOP16mo ago
Thanks, I will give it a try.
Want results from more Discord servers?
Add your server