ok

Mini Shell

Direktori : /home2/selectio/public_html/fms-worksuite/app/Observers/
Upload File :
Current File : /home2/selectio/public_html/fms-worksuite/app/Observers/IssueObserver.php

<?php

namespace App\Observers;

use App\Events\NewIssueEvent;
use App\Models\Issue;
use App\Models\Notification;

class IssueObserver
{

    public function created(Issue $issue)
    {
        if (!isRunningInConsoleOrSeeding()) {
            event(new NewIssueEvent($issue));
        }
    }

    public function deleting(Issue $issue)
    {
        $notifyData = ['App\Notifications\NewIssue'];
        \App\Models\Notification::deleteNotification($notifyData, $issue->id);

    }

    public function creating(Issue $issue)
    {
        if (company()) {
            $issue->company_id = company()->id;
        }
    }

}

Zerion Mini Shell 1.0