51 lines
959 B
PHP
51 lines
959 B
PHP
|
<?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
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
}
|