31 lines
599 B
PHP
31 lines
599 B
PHP
<?php
|
|
|
|
namespace App\Models\Stock;
|
|
|
|
use App\Models\Product;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ProductPackaging extends Model
|
|
{
|
|
use HasFactory;
|
|
protected $fillable = [
|
|
'product_id',
|
|
'name',
|
|
'qty_base',
|
|
];
|
|
|
|
protected $casts = [
|
|
'qty_base' => 'decimal:3',
|
|
];
|
|
|
|
/**
|
|
* Get the product that owns the packaging.
|
|
*/
|
|
public function product(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Product::class);
|
|
}
|
|
}
|