- Add Task model with subtasks, priorities, status transitions, dates, hours - Add Comment polymorphic model for tasks/issues/projects - Livewire components: TaskManager (list+filters), TaskForm (modal), TaskDetail, TaskKanban (drag&drop), TaskCalendar (FullCalendar) - TaskPolicy with permissions (view/create/edit/delete/assign/manage all) - Notifications: assigned, status change, overdue, comment added - Daily overdue notification job scheduled - Dashboard widget unifies IssueTask + Task - i18n: en/es/fr/ru (393 keys each) - Routes, navigation, offline sync support - 101 tests passing, Pint compliant on new files
36 lines
1013 B
PHP
36 lines
1013 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Models\Task;
|
|
use App\Notifications\TaskOverdueNotification;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class NotifyOverdueTasks implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public function handle(): void
|
|
{
|
|
$overdueTasks = Task::overdue()
|
|
->with(['assignee', 'project'])
|
|
->get();
|
|
|
|
foreach ($overdueTasks as $task) {
|
|
// Notify assignee
|
|
if ($task->assignee) {
|
|
$task->assignee->notify(new TaskOverdueNotification($task));
|
|
}
|
|
|
|
// Notify creator (if different from assignee)
|
|
if ($task->creator && $task->creator->id !== $task->assignee?->id) {
|
|
$task->creator->notify(new TaskOverdueNotification($task));
|
|
}
|
|
}
|
|
}
|
|
}
|