fix(outlet): ganti otorisasi
This commit is contained in:
parent
565505aa64
commit
1580ed9be0
@ -4,6 +4,7 @@
|
||||
|
||||
use App\Enums\Day;
|
||||
use App\Models\Outlet;
|
||||
use App\Traits\WithAuthorization;
|
||||
use App\Traits\WithCloseModal;
|
||||
use App\Traits\WithConfirmation;
|
||||
use App\Traits\WithMediaHandler;
|
||||
@ -18,7 +19,7 @@
|
||||
#[Title('Outlet')]
|
||||
class Index extends Component
|
||||
{
|
||||
use WithCloseModal, WithConfirmation, WithMediaHandler, WithToast;
|
||||
use WithAuthorization, WithCloseModal, WithConfirmation, WithMediaHandler, WithToast;
|
||||
|
||||
/** @var Collection<int, Outlet> */
|
||||
public Collection $outlets;
|
||||
@ -85,7 +86,7 @@ public function updatedStatus(): void
|
||||
|
||||
public function delete(Outlet $outlet): void
|
||||
{
|
||||
$this->authorize('delete outlet');
|
||||
$this->canOrAbort('create outlet');
|
||||
|
||||
$outlet->delete();
|
||||
$this->toast('Outlet berhasil dihapus.');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user