Pooja
Show the confirmation model on the submit button of the model form
Actions\Action::make('submitjob')->label('Submit Job')
->modalWidth('lg')
->modalHeading(('Submit Job'))
->modalSubheading(function (){...})
->modalFooter(function () use (){...}->modalButton(('Submit Job'))
->form([...])
->action(function (array $data) use ($job_details) : void {...}),
6 replies
filament 2.0 page getaction add button to open model
protected function getActions(): array
{
return [
Actions\Action::make('job_status') ->label('Job Status') ->tooltip('Job Status') ->modalWidth('sm') ->modalHeading(('Job Status')) ->modalSubheading(function (Job $record) { $job_status = //call the function to get status return new HtmlString( 'Job Status below. <br> <span class="font-bold">Current Status : <span class="' . $job_status[0] . '">' . $job_status[1] . '</span></span>' ); }) ->modalButton(('SET STATUS')) ->form([ Select::make('status') ->label(('Status')) ->searchable() ->reactive() ->required() ->options($status_array), Textarea::make('status_note') ->label(('Status Note')) ->rows(3), ]) ->action(function (Job $record, array $data) use ( $role_name, $auth_user_type_id, $user_type_field_name ): void { $typewho = $user_type_field_name; //logic to save status } }), ]; }
return [
Actions\Action::make('job_status') ->label('Job Status') ->tooltip('Job Status') ->modalWidth('sm') ->modalHeading(('Job Status')) ->modalSubheading(function (Job $record) { $job_status = //call the function to get status return new HtmlString( 'Job Status below. <br> <span class="font-bold">Current Status : <span class="' . $job_status[0] . '">' . $job_status[1] . '</span></span>' ); }) ->modalButton(('SET STATUS')) ->form([ Select::make('status') ->label(('Status')) ->searchable() ->reactive() ->required() ->options($status_array), Textarea::make('status_note') ->label(('Status Note')) ->rows(3), ]) ->action(function (Job $record, array $data) use ( $role_name, $auth_user_type_id, $user_type_field_name ): void { $typewho = $user_type_field_name; //logic to save status } }), ]; }
3 replies