/** * Run the database seeds. * * @return void */ public function run() { $recipes = ['baked potatoes with wild mushroom ragù' => ['potatoTest'], 'Buttermilk, Cornmeal Pancakes with Corn Salsa' => ['cornTest'], 'Thai Basil Eggplant' => ['eggplantTest']]; foreach ($recipes as $title => $ingredients) { $recipe = \App\Recipe::where('title', 'like', $title)->first(); foreach ($ingredients as $ingredient) { $ingredientName = \App\Ingredient::where('name', 'LIKE', $ingredient)->first(); $recipe->ingredients()->save($ingredientName); } } }
function ingredientsFromString($str, Recipe $recipe) { $ingredients = explode(',', $str); foreach ($ingredients as $ingredient) { $ingToSave = \App\Ingredient::where('name', '=', trim($ingredient))->first(); ## Check singular form if necessary if (!isset($ingToSave)) { $ingToSave = \App\Ingredient::where('name', '=', trim(str_singular($ingredient)))->first(); } ## Links ingredient to recipe, or adds new ingredient and links if (isset($ingToSave)) { $recipe->ingredients()->save($ingToSave); } else { $newIng = new \App\Ingredient(); $newIng->name = $ingredient; $newIng->save(); $recipe->ingredients()->save($newIng); } } }
public function getSecret() { $data['recipe'] = Recipe::find(1); $data['recipe']['ingredients'] = Ingredient::where('recipe_id', '=', Recipe::find(1)->id)->get(); return response()->json($data); }
public function postSearch(Request $request) { $recipes = new \App\Recipe(); if (empty($request->title) && empty($request->ingredient)) { \Session::flash('flash_message', 'Please enter a title or ingredient'); return view('search'); } elseif (!empty($request->title)) { if ($request->mineall == 'mine') { $recipes = \App\Recipe::where('title', 'LIKE', '%' . $request->title . '%')->where('user_id', '=', \Auth::id())->get(); } else { $recipes = \App\Recipe::where('title', 'LIKE', '%' . $request->title . '%')->get(); } return view('search')->with('recipes', $recipes); } else { $ingredient = $request->ingredient; if ($request->mineall == 'mine') { $recipes = \App\Recipe::whereHas('ingredients', function ($f) use($ingredient) { $f->where('name', 'LIKE', '%' . $ingredient . '%'); })->where('user_id', '=', \Auth::id())->get(); } else { $recipes = \App\Recipe::whereHas('ingredients', function ($f) use($ingredient) { $f->where('name', 'LIKE', '%' . $ingredient . '%'); })->get(); } ## if ingredient isn't found, search under other names if ($recipes->isEmpty()) { if ($request->mineall == 'mine') { $recipes = \App\Recipe::whereHas('ingredients', function ($f) use($ingredient) { $f->where('parallel_name', 'LIKE', '%' . $ingredient . '%'); })->where('user_id', '=', \Auth::id())->get(); } else { $recipes = \App\Recipe::whereHas('ingredients', function ($f) use($ingredient) { $f->where('parallel_name', 'LIKE', '%' . $ingredient . '%'); })->get(); } } $categoryIngredient = \App\Ingredient::where('name', '=', $ingredient)->first(); if ($recipes->isEmpty() && isset($categoryIngredient)) { $category = $categoryIngredient->category; if ($request->mineall == 'mine') { $recipes = \App\Recipe::whereHas('ingredients', function ($f) use($category) { $f->where('category', '=', $category); })->where('user_id', '=', \Auth::id())->get(); } else { $recipes = \App\Recipe::whereHas('ingredients', function ($f) use($category) { $f->where('category', '=', $category); })->get(); } if ($recipes->isEmpty()) { \Session::flash('flash_message', 'No recipes found with this ingredient'); return view('search'); } else { \Session::flash('flash_message', 'No recipes found with this ingredient - try using it in one of these'); return view('search')->with('recipes', $recipes); } } } if ($recipes->isEmpty()) { \Session::flash('flash_message', 'No recipes found with this ingredient'); return view('search'); } return view('search')->with('recipes', $recipes); }
public function search(Request $request) { //validate user input. $rules = ['search' => 'min:3|required']; $messages = ['search.min' => 'Devi inserire almeno 3 caratteri da cercare!', 'search.required' => 'Devi inserire almeno 3 caratteri da cercare!']; $validator = Validator::make($request->all(), $rules, $messages); $errors = $validator->errors(); if ($validator->fails()) { return redirect()->route('recipes')->withErrors($errors); } //queries $recipesMatches = \App\Recipe::where('title', 'like', '%' . $request->search . '%')->orWhere('procedure', 'like', '%' . $request->search . '%')->get(); $usersMatches = \App\User::where('name', 'like', '%' . $request->search . '%')->orWhere('email', 'like', '%' . $request->search . '%')->get(); $ingredientsMatches = \App\Ingredient::where('name', 'like', '%' . $request->search . '%')->get(); $searchInput = $request->search; //highlight what we have found! foreach ($ingredientsMatches as $ingredient) { if (stripos($ingredient->name, $searchInput) !== false) { $ingredient->name = substr_replace($ingredient->name, '<b class="highlight">' . $searchInput . '</b>', stripos($ingredient->name, $searchInput), strlen($searchInput)); } } foreach ($recipesMatches as $recipe) { if (stripos($recipe->title, $searchInput) !== false) { $recipe->title = substr_replace($recipe->title, '<b class="highlight">' . $searchInput . '</b>', stripos($recipe->title, $searchInput), strlen($searchInput)); } if (stripos($recipe->procedure, $searchInput) !== false) { $recipe->procedure = substr_replace($recipe->procedure, '<b class="highlight">' . $searchInput . '</b>', stripos($recipe->procedure, $searchInput), strlen($searchInput)); } } foreach ($usersMatches as $user) { if (stripos($user->name, $searchInput) !== false) { $user->name = substr_replace($user->name, '<b class="highlight">' . $searchInput . '</b>', stripos($user->name, $searchInput), strlen($searchInput)); } if (stripos($user->email, $searchInput) !== false) { $user->email = substr_replace($user->email, '<b class="highlight">' . $searchInput . '</b>', stripos($user->email, $searchInput), strlen($searchInput)); } } return view('results', ['ingredientsMatches' => $ingredientsMatches, 'recipesMatches' => $recipesMatches, 'usersMatches' => $usersMatches, 'searchInput' => $request->search]); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show(Request $request, $id) { $food = Food::where('id', $id)->first(); $food_ingredient = Ingredient::where('food_id', $id)->get(); $proteins = $food->proteins; $carbs = $food->carbs; $fats = $food->fats; $fibre = $food->fibre; $kcal = $food->kcal; $chart_data = ['proteins' => $proteins, 'fats' => $fats, 'carbs' => $carbs, 'fibre' => $fibre, 'kcal' => $kcal]; $chart_data = json_encode($chart_data); return view('foods.show')->with('food', $food)->with('food_ingredient', $food_ingredient)->with('chart_data', $chart_data); }
/** * Run the database seeds. * * @return void */ public function run() { //type 1 - grain, 2 - hops, 3 - yeast, 4 - sugar, 4 - additives $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '2 Row Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain1', 'amt' => '15', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Crystal Malt 40L')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain2', 'amt' => '1', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Munich Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain3', 'amt' => '.5', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Victory Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain4', 'amt' => '.5', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Columbus')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops1', 'amt' => '3', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Cascade')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops2', 'amt' => '4', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Wyeast 1056-Ale American')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '3', 'order' => 'yeast', 'amt' => '1', 'measure' => 'package', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Amylase Enzyme')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive1', 'amt' => '1', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive2', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar1', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar2', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Liberty Bay IPA')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); //type 1 - grain, 2 - hops, 3 - yeast, 4 - sugar, 4 - additives $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '2 Row Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain1', 'amt' => '15', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Crystal Malt 40L')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain2', 'amt' => '1', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Munich Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain3', 'amt' => '.5', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Victory Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain4', 'amt' => '.5', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Columbus')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops1', 'amt' => '3', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Cascade')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops2', 'amt' => '4', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Wyeast 1056-Ale American')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '3', 'order' => 'yeast', 'amt' => '1', 'measure' => 'package', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Amylase Enzyme')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive1', 'amt' => '1', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive2', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar1', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar2', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Alaskan Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); //type 1 - grain, 2 - hops, 3 - yeast, 4 - sugar, 4 - additives $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '2 Row Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain1', 'amt' => '15', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Crystal Malt 40L')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain2', 'amt' => '1', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Munich Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain3', 'amt' => '.5', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Victory Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain4', 'amt' => '.5', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Columbus')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops1', 'amt' => '3', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Cascade')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops2', 'amt' => '4', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Wyeast 1056-Ale American')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '3', 'order' => 'yeast', 'amt' => '1', 'measure' => 'package', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Amylase Enzyme')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive1', 'amt' => '1', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive2', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar1', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar2', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jill Lager')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); //type 1 - grain, 2 - hops, 3 - yeast, 4 - sugar, 4 - additives $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '2 Row Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain1', 'amt' => '15', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Crystal Malt 40L')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain2', 'amt' => '1', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Munich Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain3', 'amt' => '.5', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Victory Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain4', 'amt' => '.5', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Columbus')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops1', 'amt' => '3', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Cascade')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops2', 'amt' => '4', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Wyeast 1056-Ale American')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '3', 'order' => 'yeast', 'amt' => '1', 'measure' => 'package', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Amylase Enzyme')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive1', 'amt' => '1', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive2', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar1', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar2', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Amber')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); //type 1 - grain, 2 - hops, 3 - yeast, 4 - sugar, 4 - additives $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '2 Row Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain1', 'amt' => '15', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Crystal Malt 40L')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain2', 'amt' => '1', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Munich Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain3', 'amt' => '.5', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Victory Malt')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain4', 'amt' => '.5', 'measure' => 'lb', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '1', 'order' => 'grain5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Columbus')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops1', 'amt' => '3', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Cascade')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops2', 'amt' => '4', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '2', 'order' => 'hops5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Wyeast 1056-Ale American')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '3', 'order' => 'yeast', 'amt' => '1', 'measure' => 'package', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', 'Amylase Enzyme')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive1', 'amt' => '1', 'measure' => 'oz', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive2', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '5', 'order' => 'additive5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar1', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar2', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar3', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar4', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); $beer_id = \App\Beer::where('beer_name', '=', 'Jamal Porter')->pluck('id'); $ingredient_id = \App\Ingredient::where('name', '=', '')->pluck('id'); DB::table('recipes')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'type' => '4', 'order' => 'sugar5', 'amt' => '', 'measure' => '', 'beer_id' => $beer_id, 'ingredient_id' => $ingredient_id]); }