first commit
This commit is contained in:
50
app/Observers/WarningObserver.php
Normal file
50
app/Observers/WarningObserver.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Observers;
|
||||
use App\Notifications\HrActionNotification;
|
||||
use Modules\Admin\Models\Warning;
|
||||
|
||||
|
||||
class WarningObserver
|
||||
{
|
||||
/**
|
||||
* Handle the Warning "created" event.
|
||||
*/
|
||||
public function created(Warning $warning): void
|
||||
{
|
||||
$employee = $warning->warningRecipient;
|
||||
$employee->notify(new HrActionNotification('warning', $warning,'you have been warned'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the Warning "updated" event.
|
||||
*/
|
||||
public function updated(Warning $warning): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the Warning "deleted" event.
|
||||
*/
|
||||
public function deleted(Warning $warning): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the Warning "restored" event.
|
||||
*/
|
||||
public function restored(Warning $warning): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the Warning "force deleted" event.
|
||||
*/
|
||||
public function forceDeleted(Warning $warning): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user