diff --git a/app/Models/Recipe.php b/app/Models/Recipe.php index 4141d50..d45229c 100644 --- a/app/Models/Recipe.php +++ b/app/Models/Recipe.php @@ -123,18 +123,24 @@ class Recipe extends Model } /** - * Get recipe name from crafted item. + * Get recipe name from crafted item or spell. */ public function getNameAttribute() { + if ($this->spell) { + return $this->spell->name; + } return $this->craft->name; } /** - * Get recipe slug from crafted item. + * Get recipe slug from crafted item or spell. */ public function getSlugAttribute() { + if ($this->spell) { + return $this->spell->slug; + } return $this->craft->slug; } }