DEV Community

Haritsinh Gohil
Haritsinh Gohil

Posted on

Answer: Get Specific Columns Using “With()” Function in Laravel Eloquent

If you want to get specific columns using with() in laravel eloquent then you can use code as below which is originally answered by @adam 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)