Initial commit

This commit is contained in:
2025-10-11 17:02:49 +02:00
commit 92056f073f
243 changed files with 27536 additions and 0 deletions

34
app/Models/Product.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
use HasFactory;
protected $table = 'products';
protected $fillable = [
'sort_order',
'category',
'products',
'description'
];
protected $casts = [
'products' => 'array',
];
public function ingredients()
{
return Ingredient::whereIn('id', collect($this->products ?? [])
->pluck('ingredients')
->flatten()
->unique()
->toArray()
);
}
}