add projet
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\BaseModel;
|
||||
|
||||
class NavItem extends BaseModel
|
||||
{
|
||||
protected $table = 'nav_items';
|
||||
protected $primaryKey = 'id';
|
||||
public $timestamps = true;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $fillable = [
|
||||
'menu_parent_id',
|
||||
'label',
|
||||
'url',
|
||||
'icon_class',
|
||||
'target',
|
||||
'sort_order',
|
||||
'is_enabled',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
public function getChildrenOf(int $parentId): array
|
||||
{
|
||||
return $this->where('parent_id', $parentId)
|
||||
->where('is_enabled', 1)
|
||||
->orderBy('sort_order', 'ASC')
|
||||
->findAll();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user