34 lines
599 B
PHP
34 lines
599 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CartItem extends Model
|
|
{
|
|
use HasFactory;
|
|
protected $table = 'cart_items';
|
|
|
|
protected $fillable = [
|
|
'cart_id',
|
|
'product_id',
|
|
'quantity',
|
|
'price',
|
|
'title',
|
|
'group_type',
|
|
'gold_price',
|
|
];
|
|
|
|
public function cart()
|
|
{
|
|
return $this->belongsTo(Cart::class);
|
|
}
|
|
|
|
protected function serializeDate(\DateTimeInterface $date)
|
|
{
|
|
return $date->format('Y-m-d H:i:s');
|
|
}
|
|
|
|
}
|