32 lines
850 B
PHP
32 lines
850 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Notifications;
|
||
|
|
|
||
|
|
use App\Models\IssueTask;
|
||
|
|
use Illuminate\Bus\Queueable;
|
||
|
|
use Illuminate\Notifications\Notification;
|
||
|
|
|
||
|
|
class IssueTaskOverdueNotification extends Notification
|
||
|
|
{
|
||
|
|
use Queueable;
|
||
|
|
|
||
|
|
public function __construct(public IssueTask $task) {}
|
||
|
|
|
||
|
|
public function via($notifiable): array
|
||
|
|
{
|
||
|
|
return ['database'];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function toArray($notifiable): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'type' => 'issue_task_overdue',
|
||
|
|
'issue_id' => $this->task->issue_id,
|
||
|
|
'task_id' => $this->task->id,
|
||
|
|
'project_id' => $this->task->issue?->project_id,
|
||
|
|
'due_date' => $this->task->due_date?->toDateString(),
|
||
|
|
'message' => "Tarea vencida: '{$this->task->title}' (venció el {$this->task->due_date?->format('d/m/Y')})",
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|