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>
26 lines
434 B
PHP
26 lines
434 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class BatchOrigin extends Model
|
|
{
|
|
protected $fillable = ['batch_id', 'spice_id'];
|
|
|
|
public function batch()
|
|
{
|
|
return $this->belongsTo(Batch::class);
|
|
}
|
|
|
|
public function spice()
|
|
{
|
|
return $this->belongsTo(Spice::class);
|
|
}
|
|
|
|
public function entries()
|
|
{
|
|
return $this->hasMany(BatchOriginEntry::class);
|
|
}
|
|
}
|