src/Models/Ticket.php
public function scopeAgentUserTickets($query, $id)
    {
        return $query->where(function ($subquery) use ($id) {
            $subquery->where('agent_id', $id)->orWhere('user_id', $id);
        });
    }
public function scopeAgentUserTickets($query, $id)
    {
        return $query->where(function ($subquery) use ($id) {
            $subquery->where('agent_id', $id)->orWhere('user_id', $id);
        });
    }
public function scopeAgentUserTickets ( $ query , $ id ) { return $ query -> where ( function ( $ subquery ) use ( $ id ) { $ subquery -> where ( 'agent_id' , $ id ) -> orWhere ( 'user_id' , $ id ) ; } ) ; }
Get all agent tickets.

@param $query
@param $id

@return mixed
Get all agent tickets .