¨4.0.1¨
This commit is contained in:
29
Modules/Cart/Entities/Cart.php
Normal file
29
Modules/Cart/Entities/Cart.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user