Ejemplo n.º 1
0
 public static function userHasAgent()
 {
     if (Entrust::hasRole('Agent')) {
         if ($x = User::getAgentOfUser(Auth::user())) {
             return Agent::with('market')->find($x->agent_id);
         }
     }
     return false;
 }
Ejemplo n.º 2
0
 public static function getAgents()
 {
     return Agent::with(['user', 'market'])->get();
 }