Restructure batch origins: nested entries per ingredient with Supplier/Farmer selects
Deploy / deploy (push) Successful in 14s

Each BatchOrigin (spice) now has multiple BatchOriginEntry rows, replacing the flat
single-supplier/farmer fields. Lieferant and Landwirt are Select fields backed by
dedicated tables with inline create support. Migration preserves existing data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Malek TellissiandClaude Sonnet 4.6 committed 2026-09-12 20:03:05 +02:00
1 parent 400237aa5b
commit 4a98beeb45
6 files changed
+221 -89

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class BatchOriginEntry extends Model
{
protected $fillable = ['batch_origin_id', 'supplier_id', 'origin_country', 'farmer_id', 'notes'];
public function batchOrigin()
{
return $this->belongsTo(BatchOrigin::class);
}
public function supplier()
{
return $this->belongsTo(Supplier::class);
}
public function farmer()
{
return $this->belongsTo(Farmer::class);
}
}