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

@param int $id ticket id

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