Init
This commit is contained in:
30
app/Models/Product.php
Normal file
30
app/Models/Product.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user