Initial commit
This commit is contained in:
39
app/Http/Livewire/NotifyUnauthorizedAction.php
Normal file
39
app/Http/Livewire/NotifyUnauthorizedAction.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use Livewire\Component;
|
||||
use WireUi\Traits\WireUiActions;
|
||||
|
||||
|
||||
class NotifyUnauthorizedAction extends Component
|
||||
{
|
||||
use WireUiActions;
|
||||
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->notify();
|
||||
}
|
||||
|
||||
public function notify()
|
||||
{
|
||||
// WireUI notification
|
||||
|
||||
$this->notification()->warning(
|
||||
$title = __('Unauthorized action'),
|
||||
$description = session('unauthorizedAction'),
|
||||
);
|
||||
}
|
||||
|
||||
public function dehydrate()
|
||||
{
|
||||
// Clear the session key after the component is rendered
|
||||
session()->forget('unauthorizedAction');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.notify-unauthorized-action');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user