/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { $agents = Agent::all(); if ($request->ajax()) { return $agents->toArray(); } return view('admin.agents.index', ['agents' => $agents]); }
/** * Will display all users that are registered and have access * to some part of the database * @todo * should only be available to the admins * */ public function index() { $agents = Agent::all(); return view('agents.index', compact('agents')); }
public function showAgents() { $agents = \App\Agent::all(); return view('pages.listAgents')->with(['agents' => $agents, 'communities' => $this->communities]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $agents = Agent::all()->take(8); return response()->success(compact('agents')); }