From 2a559cb3818c9b11577007801192b78116fd97cd Mon Sep 17 00:00:00 2001 From: Beth Parker Date: Mon, 7 Feb 2022 19:10:11 -0600 Subject: [PATCH] Added order and alternative to recipe_ingredient and created models --- app/Recipe.php | 17 +++++++++++++++++ app/RecipeIngredient.php | 17 +++++++++++++++++ database/factories/RecipeFactory.php | 17 +++++++++++++++++ ...08_003527_create_recipe_ingredient_table.php | 2 ++ 4 files changed, 53 insertions(+) create mode 100644 app/Recipe.php create mode 100644 app/RecipeIngredient.php create mode 100644 database/factories/RecipeFactory.php diff --git a/app/Recipe.php b/app/Recipe.php new file mode 100644 index 0000000..98acda5 --- /dev/null +++ b/app/Recipe.php @@ -0,0 +1,17 @@ +hasMany('App\RecipeIngredient'); + } +} diff --git a/app/RecipeIngredient.php b/app/RecipeIngredient.php new file mode 100644 index 0000000..6a0f2d7 --- /dev/null +++ b/app/RecipeIngredient.php @@ -0,0 +1,17 @@ +belongsTo('App\Recipe'); + } +} diff --git a/database/factories/RecipeFactory.php b/database/factories/RecipeFactory.php new file mode 100644 index 0000000..c146cb1 --- /dev/null +++ b/database/factories/RecipeFactory.php @@ -0,0 +1,17 @@ +id(); $table->unsignedInteger('recipe_id'); + $table->unsignedInteger('order'); + $table->boolean('alternative'); $table->string('name'); $table->float('quantity'); $table->string('measurement');