StocksNew/app/Observers/AppreciationObserver.php

52 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2024-08-27 12:03:06 +00:00
<?php
namespace App\Observers;
use App\Notifications\HrActionNotification;
use Modules\Admin\Models\Appreciation;
use Modules\Employee\Models\Employee;
class AppreciationObserver
{
/**
* Handle the Appreciation "created" event.
*/
public function created(Appreciation $appreciation): void
{
$appreciatee = $appreciation->appreciatee;
$appreciatee->notify(new HrActionNotification('appreciation', $appreciation,'you have been appreciated.'));
}
/**
* Handle the Appreciation "updated" event.
*/
public function updated(Appreciation $appreciation): void
{
//
}
/**
* Handle the Appreciation "deleted" event.
*/
public function deleted(Appreciation $appreciation): void
{
//
}
/**
* Handle the Appreciation "restored" event.
*/
public function restored(Appreciation $appreciation): void
{
//
}
/**
* Handle the Appreciation "force deleted" event.
*/
public function forceDeleted(Appreciation $appreciation): void
{
//
}
}