33 lines
799 B
PHP
33 lines
799 B
PHP
<?php
|
||
namespace App\Models;
|
||
|
||
use Illuminate\Database\Eloquent\Model;
|
||
|
||
class StockEntries2Section extends Model
|
||
{
|
||
protected $table = 'stock_entries2section';
|
||
public $incrementing = false;
|
||
public $timestamps = true;
|
||
|
||
// Composite PKs aren’t natively supported by Eloquent;
|
||
// you can override getKey() / setKey*() if needed, or treat this as a pure pivot.
|
||
protected $primaryKey = null;
|
||
|
||
protected $fillable = [
|
||
'entry_id',
|
||
'section_id',
|
||
'count',
|
||
];
|
||
|
||
public function section()
|
||
{
|
||
return $this->belongsTo(StockSection::class, 'section_id', 'section_id');
|
||
}
|
||
|
||
// assuming you have an App\Models\StockEntry model
|
||
public function entry()
|
||
{
|
||
return $this->belongsTo(StockEntry::class, 'entry_id', 'id');
|
||
}
|
||
}
|