Using fields() with asArray()

In a endpoint, i will show the resource with all relations and without use expand parameter.

When i use the followin ActiveQuery, the fields() are respected but i need use expand parameter to show relations




Model::Find()->all();



if use asArray(), the fields() is ignored and show all data including relations (wich i want)




Model::Find()->asArray()->all();



Is there something else to do?

1 Like