public function getHomePage($id = null) { $homes = HomePage::orderBy('id')->get(); if ($id) { $home = HomePage::find($id); } else { $home = null; } return View::make('admin.home', array('homes' => $homes, 'home' => $home)); }