Repository navigation
Replies: 2 comments 2 replies
1 reply
|
Sure, I don't understand the demo page but now I understand that I need to include the relationship column, thanks <3 |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
In my learning path I understood that I should bring only the columns that I am going to use and not all the columns and this would allow me to have fast and efficient queries, but when trying to do a select and at the same time bring data from a relation it responds with the null relation:
example:
$users = User::select('id','name')->with('post')->get();or$users = User::select(['id','name'])->with('post')->get();it doesn't work for me, I use
dd($users)and I verify that in relations I get nullif I remove "select" it correctly brings the relation data, am I doing something wrong?
All reactions