Eager load form relations

pepijn - 10 months ago

Hi,

I know I can eager load stuff in a TableBuilder, using the syntax below, but it seems this is not respected for the FormBuilder. As a result, a ton of queries get executed, and this admin page feels really slow.

How can I eager load form relations ?

 protected $options = [
        'eager' => [
            'translations',
            'relatedModel',
        ],
    ];

eager_load_forms.png

ryanthompson - 10 months ago

You can eager load relations using protected $with = [relations]; in your model just like normal Laravel.