Support the ongoing development of Laravel.io →
Requests Database Eloquent
Last updated 2 years ago.
0

If you're using the toArray method, you might want to consider correcting this in your models instead - by defining the "hidden" parameter. See the following link, under the heading Hiding Attributes From Array Or JSON Conversion.

http://laravel.com/docs/4.2/eloquent#converting-to-arrays-or-json

0

Thank you AndrewBNZ,

with using the "hidden" paramter, the fields will be missed in all requests.

I want to get all fields by default - and then select the needed field from query to query (not within the query but within the several functions).

0

Case has been solved in https://laracasts.com/discuss/channels/general-discussion/select-fields-in-complex-with-queries by other user.

Solution: There has to be a foreign key in the selection array

0

Sign in to participate in this thread!

Eventy

Your banner here too?

snoopy72 snoopy72 Joined 2 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.