Files
SpiceManagementSystem/app/Models/Recipe.php
T
Malek TellissiandClaude Sonnet 4.6 a7f5c4a83e
Deploy / deploy (push) Successful in 15s
Recipe versioning, inline recipe create, recipe summary, Shopify description
- Add version + product_id to recipes table (migration)
- Recipe select shows version label (e.g. "Kurkuma v2")
- Creating recipe from product page pre-fills product name, auto-increments version
- Recipe ingredient summary shown read-only below the select
- Remove package_content field (redundant with recipe ingredients)
- Pull product description from Shopify body_html on import
- Update existing products with empty description on re-import

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-12 05:18:11 +02:00

28 lines
559 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Recipe extends Model
{
use HasFactory;
protected $fillable = ['name', 'description', 'product_id', 'version'];
public function product()
{
return $this->belongsTo(Product::class);
}
public function spices()
{
return $this->belongsToMany(Spice::class, 'recipes_spices')
->withPivot('amount_in_percent')
->withTimestamps();
}
}