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 run() { foreach (['Protein', 'Starch', 'Vegetable', 'Other'] as $type) { $model = \Excessive\IDF\Models\PortionType::where('name', $type)->first(); if ($model) { continue; } $model = new \Excessive\IDF\Models\PortionType(); $model->name = $type; $model->save(); } }
public function ingredients($id) { $portion = Portion::find($id); $types = PortionType::all(); return \View::make('portions.ingredients')->with(['types' => $types, 'portion' => $portion])->render(); }