Exemple #1
0
 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();
 }
Exemple #2
0
 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();
     }
 }
Exemple #3
0
 public function ingredients($id)
 {
     $portion = Portion::find($id);
     $types = PortionType::all();
     return \View::make('portions.ingredients')->with(['types' => $types, 'portion' => $portion])->render();
 }