create menu crud
This commit is contained in:
@@ -26,12 +26,19 @@ class Menu extends Model
|
||||
'deleteable',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
protected $with = [
|
||||
'permissions',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function parent()
|
||||
{
|
||||
return $this->hasOne(Menu::class, 'id', 'parent_id')->without(['childs'])->with(['parent']);
|
||||
return $this->hasOne(Menu::class, 'id', 'parent_id')->without(['childs'])->withCount(['childs']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user