Dec 20, 2024
0
Level 2
Close Paranet Modal

I have this glance action which opens the modal. Within that modal, I have info lost and two Buttons Approved and rejected. I want to close the parent Glance model when the user clicks on one of the buttons. Here is the code of my action
->icon('heroicon-o-eye')
->infolist([
Grid::make(2)->schema([
TextEntry::make('starts_at')
->dateTime(app(GeneralSettings::class)->dateFormat . ' ' . app(GeneralSettings::class)->timeFormat),
TextEntry::make('ends_at')->dateTime(app(GeneralSettings::class)->dateFormat . ' ' . app(GeneralSettings::class)->timeFormat),
TextEntry::make('appointee.name'),
TextEntry::make('appointer.name'),
TextEntry::make('notes'),
TextEntry::make('status.name')->formatStateUsing(function (Appointment $record) {
return ucfirst($record->status->name);
})->color(function (Appointment $record) {
return $record->status->color;
})->icon(function (Appointment $record) {
return $record->status->icon;
}),
TextEntry::make('created_at'),
TextEntry::make('updated_at'),
])
])
->modalCancelAction(false)
->modalSubmitAction(false)
->extraModalFooterActions([
ActionsAction::make('approve')
->label('Approve')
->icon('heroicon-o-check-circle')
->action(function (Appointment $record) {
$record->update([
'status_id' => rand(1, 3),
]);
})->modalAutofocus(false),
ActionsAction::make('reject')
->label('Reject')
->icon('heroicon-o-check-circle')
->action('reject')->modalAutofocus(false),
])
->button()
->modalAutofocus(false)
->label('Glance')
and Here is the Link to the Gist file containing whole page code. 'Gist'
Please or to participate in this conversation.