If you want to get specific columns using with() in laravel eloquent then you can use code as below which is originally answered by
in his answer here in response of this same question :
Post::with('user:id,username')->get();
So i have used it in my code but it was giving me…
Top comments (0)