24 lines
745 B
PHP
24 lines
745 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Modules\Booking\Filament\Resources\Bookings\Actions;
|
||
|
|
|
||
|
|
use Filament\Actions\DeleteAction;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Soft-delete only (Booking uses SoftDeletes). `authorize('delete')` ties
|
||
|
|
* both the visible/hidden state AND the actual delete call itself to
|
||
|
|
* BookingPolicy::delete (manage_bookings + terminal status) — unlike
|
||
|
|
* visible()/disabled(), which are UI-only, authorize() is enforced when the
|
||
|
|
* action runs (Filament\Actions\Concerns\CanBeAuthorized). A booking that
|
||
|
|
* isn't cancelled/expired never shows this button at all, rather than a
|
||
|
|
* dead disabled one.
|
||
|
|
*/
|
||
|
|
class DeleteBookingTableAction
|
||
|
|
{
|
||
|
|
public static function make(): DeleteAction
|
||
|
|
{
|
||
|
|
return DeleteAction::make()
|
||
|
|
->authorize('delete');
|
||
|
|
}
|
||
|
|
}
|