Files
docker-rconfig/app/Jobs/TaskCompleteNotificationJob.php
2024-10-19 18:23:55 +00:00

32 lines
925 B
PHP

<?php
namespace App\Jobs;
use App\Models\User;
use App\Notifications\DBTaskCompleteNotification;
use App\Notifications\MailTaskCompleteNotification;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Notification;
class TaskCompleteNotificationJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $report_data;
public function __construct($report_data)
{
$this->report_data = $report_data;
}
public function handle()
{
Notification::send(User::allUsersAndRecipients(), new MailTaskCompleteNotification($this->report_data));
Notification::send(User::allUsersAndRecipients(), new DBTaskCompleteNotification($this->report_data));
}
}