26 lines
484 B
PHP
26 lines
484 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class StockLevel extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = ['item_id', 'warehouse_id', 'quantity'];
|
|
|
|
protected $casts = ['quantity' => 'decimal:2'];
|
|
|
|
public function item()
|
|
{
|
|
return $this->belongsTo(Item::class);
|
|
}
|
|
|
|
public function warehouse()
|
|
{
|
|
return $this->belongsTo(Warehouse::class);
|
|
}
|
|
}
|