28 lines
550 B
PHP
28 lines
550 B
PHP
<?php
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class StockShelf extends Model
|
|
{
|
|
protected $table = 'stock_shelf';
|
|
protected $primaryKey = 'shelf_id';
|
|
public $timestamps = true;
|
|
|
|
protected $fillable = [
|
|
'shelf_symbol',
|
|
'shelf_name',
|
|
'rack_id',
|
|
];
|
|
|
|
public function rack()
|
|
{
|
|
return $this->belongsTo(StockRack::class, 'rack_id', 'rack_id');
|
|
}
|
|
|
|
public function positions()
|
|
{
|
|
return $this->hasMany(StockPosition::class, 'shelf_id', 'shelf_id');
|
|
}
|
|
}
|