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

36 lines
576 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
class ModelAttribute extends Model
{
protected $table = 'model_attributes';
protected $fillable = [
"name",
"value"
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
"value" => "array",
];
}
public function owner(): morphTo
{
return $this->morphTo();
}
}