/** * Display a listing of breweries * * @return Response */ public function index() { if (Request::ajax()) { $breweries = Brewery::all(); return Response::json($breweries); } else { $breweries = Brewery::with('beer')->get(); return View::make('breweries.index')->with(['breweries' => $breweries]); } }
public static function create_vars(&$vars) { $vars['breweries'] = Brewery::all(); $vars['styles'] = Style::all(); }