/** * Responds to requests to GET /batches/create */ public function getCreate($incomingRecipeID = null) { //get list of recipes currently in the database for selection by the user $recipes = \p4\Recipe::all(); if ($incomingRecipeID != null) { $recipeLookup = \p4\Recipe::where('id', '=', $incomingRecipeID)->get(); //return 'THIS IS THE INCOMING RECIPE: '.$recipeLookup; return view('batches.create')->with('recipes', $recipeLookup); } else { //return 'Form to create a new batch'; return view('batches.create')->with('recipes', $recipes); } }
/** * Responds to requests to GET /recipes/show */ public function getShow() { $recipes = \p4\Recipe::all(); return view('recipes.show')->with('recipes', $recipes); }