I'm doing exactly what is described here
However, I added this code in my resource
public static function indexQuery(NovaRequest $request, $query)
{
return $query->doesntHave('parent');
}
In order to only show in index, Posts that did not contain parent;
Problem is that this query is also applied in HasMany field;
Children didn't shown on Post Detail
I'm wondering if there's something like $request->isFromRelation()
that return true if $request is made for relation purpose and then, I can do this :
public static function indexQuery(NovaRequest $request, $query)
{
if(!$request->isFromRelation())
return $query->doesntHave('parent');
}