| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentBooking\App\Models; |
| 4 |
class Meta extends Model |
| 5 |
{ |
| 6 |
protected $table = 'fcal_meta'; |
| 7 |
|
| 8 |
protected $guarded = ['id']; |
| 9 |
|
| 10 |
protected $fillable = [ |
| 11 |
'object_type', |
| 12 |
'object_id', |
| 13 |
'key', |
| 14 |
'value' |
| 15 |
]; |
| 16 |
|
| 17 |
public static function boot() |
| 18 |
{ |
| 19 |
parent::boot(); |
| 20 |
} |
| 21 |
|
| 22 |
public function setValueAttribute($value) |
| 23 |
{ |
| 24 |
$this->attributes['value'] = \maybe_serialize($value); |
| 25 |
} |
| 26 |
|
| 27 |
public function getValueAttribute($value) |
| 28 |
{ |
| 29 |
return \maybe_unserialize($value); |
| 30 |
} |
| 31 |
|
| 32 |
public function calendar_event() |
| 33 |
{ |
| 34 |
return $this->belongsTo(CalendarSlot::class, 'object_id'); |
| 35 |
} |
| 36 |
|
| 37 |
} |
| 38 |
|