Erster Upload
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SpiceSupplier extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'spices_suppliers'; // explizit, weil der Standard sonst 'spice_suppliers' wäre
|
||||
|
||||
protected $fillable = [
|
||||
'spice_id',
|
||||
'supplier_id',
|
||||
'amount',
|
||||
'supplied_at',
|
||||
];
|
||||
|
||||
// Beziehungen
|
||||
public function spice()
|
||||
{
|
||||
return $this->belongsTo(Spice::class);
|
||||
}
|
||||
|
||||
public function supplier()
|
||||
{
|
||||
return $this->belongsTo(Supplier::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user