initial: bootstrap from BukidBountyApp base
This commit is contained in:
39
app/Models/Market/CartItem.php
Normal file
39
app/Models/Market/CartItem.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models\Market;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class CartItem extends Model
|
||||
{
|
||||
protected ?string $table = 'cart_items';
|
||||
|
||||
protected array $fillable = [
|
||||
'hashkey',
|
||||
'cart_id',
|
||||
'product_id',
|
||||
'quantity',
|
||||
'price',
|
||||
'is_active',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
protected array $casts = [
|
||||
'is_active' => 'boolean',
|
||||
'quantity' => 'integer',
|
||||
'price' => 'float',
|
||||
];
|
||||
|
||||
public function cart()
|
||||
{
|
||||
return $this->belongsTo(Cart::class, 'cart_id');
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(Product::class, 'product_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user