diff --git a/app/Jobs/ImportProfession.php b/app/Jobs/ImportProfession.php index a91d9e4..0fb4e0f 100644 --- a/app/Jobs/ImportProfession.php +++ b/app/Jobs/ImportProfession.php @@ -202,7 +202,8 @@ class ImportProfession implements ShouldQueue $recipe = $profession->recipes()->create([ 'item_id' => $crafted ? $crafted->id : null, 'spell_id' => $spell->id, - 'category_id' => $category->id + 'category_id' => $category->id, + 'description' => isset($data->description) ? $data->description : null ]); } // Existing record. @@ -216,6 +217,10 @@ class ImportProfession implements ShouldQueue if (!$recipe->spell) { $recipe->spell()->associate($spell); } + + if ($recipe->description === NULL && isset($data->description)) { + $recipe->description = $data->description; + } } // Insert/Update Reagents diff --git a/app/Models/Recipe.php b/app/Models/Recipe.php index 13cb4f9..1d3db68 100644 --- a/app/Models/Recipe.php +++ b/app/Models/Recipe.php @@ -34,7 +34,8 @@ class Recipe extends Model 'profession_id', 'category_id', 'item_id', - 'spell_id' + 'spell_id', + 'description' ]; /** diff --git a/database/migrations/2021_07_08_134818_add_description_column_to_recipes_table.php b/database/migrations/2021_07_08_134818_add_description_column_to_recipes_table.php new file mode 100644 index 0000000..ac7d643 --- /dev/null +++ b/database/migrations/2021_07_08_134818_add_description_column_to_recipes_table.php @@ -0,0 +1,20 @@ +text('description')->nullable(); + }); + } +} diff --git a/resources/views/recipe/show.blade.php b/resources/views/recipe/show.blade.php index 9518937..aa0f639 100644 --- a/resources/views/recipe/show.blade.php +++ b/resources/views/recipe/show.blade.php @@ -9,6 +9,10 @@
{{ $recipe->description }}
+ @endif + @if ($recipe->craft)