public function manage($id) { $meal = Meal::find($id); $portions = Portion::all(); $portionTypes = PortionType::all(); return \View::make('meals.add')->with(['portionTypes' => $portionTypes, 'meal' => $meal, 'portions' => $portions])->render(); }
public function add($id = null) { $portions = Portion::all(); $portion = null; if (!is_null($id)) { $portion = Portion::find($id); } return \View::make('portions.add')->with(['portions' => $portions, 'portion' => $portion])->render(); }