You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
545 B
28 lines
545 B
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class BatchShoppingCart extends Model
|
|
{
|
|
protected $fillable = ['slug', 'details'];
|
|
public $timestamps = false;
|
|
|
|
public function setDetailsAttribute($value)
|
|
{
|
|
$this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE);
|
|
}
|
|
|
|
public function getDetailsAttribute()
|
|
{
|
|
return json_decode($this->attributes['details']);
|
|
}
|
|
|
|
public function shopping_carts()
|
|
{
|
|
return $this->hasMany('App\ShoppingCart');
|
|
}
|
|
|
|
}
|