FleetCart/Modules/Cart/Entities/Cart.php
2023-12-03 14:07:47 +00:00

30 lines
495 B
PHP

<?php
namespace Modules\Cart\Entities;
use Illuminate\Database\Eloquent\Model;
class Cart extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'id', 'data',
];
public function setDataAttribute($value)
{
$this->attributes['data'] = serialize($value);
}
public function getDataAttribute($value)
{
return unserialize($value);
}
}