|
|
@@ -59,10 +59,15 @@ class FrontMenuItem extends BaseFrontMenuItem
|
|
|
/**
|
|
|
* Override the children relationship to target the API resource model,
|
|
|
* so API Platform can resolve the self-referencing relation.
|
|
|
+ *
|
|
|
+ * Disabled (status = 0) children are excluded by default so they are
|
|
|
+ * never surfaced through the API, regardless of which field accesses
|
|
|
+ * the relation.
|
|
|
*/
|
|
|
public function children()
|
|
|
{
|
|
|
return $this->hasMany(self::class, 'parent_id')
|
|
|
+ ->where('status', 1)
|
|
|
->orderBy('sort_order')
|
|
|
->orderBy('id');
|
|
|
}
|