nova-child-select
nova-child-select copied to clipboard
N+1 Query
public function fields()
{
return [
Select::make('Provider', 'provider')
->options((\App\Person::all())
->rules('required')
}
\App\Person::all() is causing N+1 Query, How do I prevent it ?
You can't prevent n+1 query in this field. Normally select field is used in Form page, you don't need to prevent it. If in special page that you have select fields in Table, I will use cache('person') instead of Persion::all().