Oct 26, 2024
0
Level 8
How to get values of related fields in view and editor pages ?
In Laravel 10 / nova 4.27 app to get values of related fields in products list I use :
public static function indexQuery(NovaRequest $request, $query)
{
$query->withCount('orderItems')->with('creator');
return parent::indexQuery($request, $query);
}
Product model has related orderItems and creator relations and it works ok in listing. But I also need to show these readonly values in view and editor pages.
indexQuery method is not applied for view and editor pages.
How can I add these relations in view and editor pages? How can I make these fields not to be updated on saving?
Please or to participate in this conversation.