<?php

namespace App\Traits;
use App\Models\Notifications;
use Illuminate\Http\Request;
use App\Events\Company\PusherNotificationEvent as CompanyNotificationEvent;

trait CreateRealTimeCompanyNotificationTraits
{
    public function createCompanyNotification($notificationData){
        $createdNotification = Notifications::create($notificationData);
        event(new CompanyNotificationEvent($createdNotification)); // trigger real time notification on pusher

        return $createdNotification;
    }
}