base commit

This commit is contained in:
Mekan1206
2026-07-30 17:24:40 +05:00
commit a794dacd39
345 changed files with 29597 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
namespace App\Notifications;
use App\Models\Employee;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class EmployeeTerminatedNotification extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(
public readonly Employee $employee,
) {}
/**
* @return list<string>
*/
public function via(object $notifiable): array
{
return ['database', 'mail'];
}
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject('Employee Terminated')
->line("{$this->employee->full_name} ({$this->employee->employee_number}) has been terminated.")
->line("Termination date: {$this->employee->termination_date?->toDateString()}");
}
/**
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
'employee_id' => $this->employee->id,
'employee_number' => $this->employee->employee_number,
'full_name' => $this->employee->full_name,
'termination_date' => $this->employee->termination_date?->toDateString(),
'department_id' => $this->employee->department_id,
];
}
}