You've already forked Atomcms-edit
27 lines
615 B
PHP
Executable File
27 lines
615 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class WebsiteNavigation extends Model
|
|
{
|
|
#[\Override]
|
|
protected $guarded = ['id', 'created_at', 'updated_at', 'order', 'visible'];
|
|
|
|
#[\Override]
|
|
public $timestamps = false;
|
|
|
|
public function children(): HasMany
|
|
{
|
|
return $this->hasMany(WebsiteNavigation::class, 'parent_id');
|
|
}
|
|
|
|
public function parent(): BelongsTo
|
|
{
|
|
return $this->belongsTo(WebsiteNavigation::class, 'parent_id');
|
|
}
|
|
}
|