category is NestedTree
public $belongsTo = [
'category' => [
'Drserv\Vo\Models\Category',
'scope' => 'isProject'
]
];
fields:
category:
label: category
type: relation
nameFrom: name
this not work for only show child
public function scopeIsProject($query)
{
return $query->where('parent_id', '=', 1);
}
but work like this (parent and child)
return $query->where('id', '=', 1)->orWhere('parent_id', '=', 1);
plx help Q_Q
Last updated