31 lines
554 B
PHP
31 lines
554 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Product extends Model
|
|
{
|
|
protected $fillable = [
|
|
'sku',
|
|
'name',
|
|
'description',
|
|
'price',
|
|
'stock_quantity',
|
|
'category',
|
|
'status',
|
|
'imported_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'price' => 'decimal:2',
|
|
'imported_at' => 'datetime',
|
|
];
|
|
|
|
public function orderItems(): HasMany
|
|
{
|
|
return $this->hasMany(OrderItem::class);
|
|
}
|
|
}
|