43 lines
854 B
PHP
43 lines
854 B
PHP
<?php
|
|
|
|
namespace App\Models\Registries;
|
|
|
|
use App\Models\Pages\Page;
|
|
use App\Support\HasObjectsTrait;
|
|
use App\Support\RelationValuesTrait;
|
|
use App\Support\UuidScopeTrait;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Registry extends Model {
|
|
use UuidScopeTrait, SoftDeletes, HasObjectsTrait, RelationValuesTrait;
|
|
|
|
protected $dates = [
|
|
];
|
|
|
|
protected $fillable = [
|
|
'uuid',
|
|
'page_id',
|
|
'type',
|
|
'name'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'id'
|
|
];
|
|
|
|
|
|
public function page(): BelongsTo {
|
|
return $this->belongsTo(Page::class);
|
|
}
|
|
|
|
|
|
|
|
public function getParsedTypeAttribute(): array {
|
|
return ['name' => $this->type, 'title' => RegistryType::TITLES[$this->type] ?? null];
|
|
}
|
|
|
|
|
|
}
|