StocksNew/app/Observers/WarningObserver.php

51 lines
959 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?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
{
//
}
}