src/Models/Agent.php
public static function isAssignedAgent($id)
    {
        if (auth()->check() && Auth::user()->ticketit_agent) {
            if (Auth::user()->id == Ticket::find($id)->agent->id) {
                return true;
            }
        }
    }
public static function isAssignedAgent($id)
    {
        if (auth()->check() && Auth::user()->ticketit_agent) {
            if (Auth::user()->id == Ticket::find($id)->agent->id) {
                return true;
            }
        }
    }
public static function isAssignedAgent ( $ id ) { if ( auth ( ) -> check ( ) && Auth :: user ( ) -> ticketit_agent ) { if ( Auth :: user ( ) -> id == Ticket :: find ( $ id ) -> agent -> id ) { return true ; } } }
Check if user is the assigned agent for a ticket.

@param int $id ticket id

@return bool
Check if user is the assigned agent for a ticket .