<?php namespace App\Observers; use App\Notifications\HrActionNotification; use Modules\Admin\Models\PromotionDemotion; use Modules\Employee\Models\Employee; class PromotionDemotionObserver { /** * Handle the PromotionDemotion "created" event. */ public function created(PromotionDemotion $promotionDemotion): void { $employee = $promotionDemotion->employee; $employee->notify(new HrActionNotification($promotionDemotion->type, $promotionDemotion,'You have been promoted')); } /** * Handle the PromotionDemotion "updated" event. */ public function updated(PromotionDemotion $promotionDemotion): void { // } /** * Handle the PromotionDemotion "deleted" event. */ public function deleted(PromotionDemotion $promotionDemotion): void { // } /** * Handle the PromotionDemotion "restored" event. */ public function restored(PromotionDemotion $promotionDemotion): void { // } /** * Handle the PromotionDemotion "force deleted" event. */ public function forceDeleted(PromotionDemotion $promotionDemotion): void { // } }