StocksNew/app/Observers/InterviewScheduleObserver.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

54 lines
1.4 KiB
PHP

<?php
namespace App\Observers;
use App\Notifications\HrActionNotification;
use Modules\Employee\Models\Employee;
use Modules\Recruit\Models\InterviewSchedule;
class InterviewScheduleObserver
{
/**
* Handle the InterviewSchedule "created" event.
*/
public function created(InterviewSchedule $interviewSchedule): void
{
$interviewers = Employee::whereIn('id', $interviewSchedule->interviewer_choices)->get();
$interviewers->each->notify(new HrActionNotification('interviewer', $interviewSchedule,'you have been selected as interviewer'));
$interviewSchedule->jobPost->jobApplications->each->notify(new HrActionNotification('interviewee', $interviewSchedule,'you interview has been scheduled'));
}
/**
* Handle the InterviewSchedule "updated" event.
*/
public function updated(InterviewSchedule $interviewSchedule): void
{
//
}
/**
* Handle the InterviewSchedule "deleted" event.
*/
public function deleted(InterviewSchedule $interviewSchedule): void
{
//
}
/**
* Handle the InterviewSchedule "restored" event.
*/
public function restored(InterviewSchedule $interviewSchedule): void
{
//
}
/**
* Handle the InterviewSchedule "force deleted" event.
*/
public function forceDeleted(InterviewSchedule $interviewSchedule): void
{
//
}
}