Files
exchange-2.0/app/Models/KeyValuePair.php

37 lines
656 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class KeyValuePair extends AbstractModel
{
use SoftDeletes;
protected $table = 'key_value_pairs';
protected $fillable = [
'owner_type',
'owner_id',
'key',
'value',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'deleted_at' => 'datetime',
];
}
public function owner(): MorphTo
{
return $this->morphTo();
}
}