first commit
This commit is contained in:
51
app/Observers/AppreciationObserver.php
Normal file
51
app/Observers/AppreciationObserver.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?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
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
53
app/Observers/InterviewScheduleObserver.php
Normal file
53
app/Observers/InterviewScheduleObserver.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?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
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
52
app/Observers/PromotionDemotionObserver.php
Normal file
52
app/Observers/PromotionDemotionObserver.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?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
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
50
app/Observers/WarningObserver.php
Normal file
50
app/Observers/WarningObserver.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?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
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user