/** * Display a listing of the resource. * * @return Response */ public function index() { // get all the nerds $nerds = Nerd::all(); // load the view and pass the nerds return view('nerds.index')->with('nerds', $nerds); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // get all nerds $nerds = Nerd::all(); // load the view and pass the $nerds return view('nerds.index', compact('nerds')); // return $nerds[0]; }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // = WAYI: // Get all nerds $nerds = Nerd::all(); $page_title = 'Nerds List'; $page_desc = 'All nerds here'; // Load the view and pass the nerds return view('nerds.index', ['nerds' => $nerds, 'page_title' => $page_title, 'page_description' => $page_desc]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $nerds = Nerd::all(); return view('nerds.index', ['nerds' => $nerds]); }