query relationships laravel and select some columns

Solutions on MaxInterview for query relationships laravel and select some columns by the best coders in the world

showing results for - "query relationships laravel and select some columns"
Nabil
16 Oct 2018
1Post::query()
2    ->with(array('user' => function($query) {
3        $query->select('id','username');
4    }))
5    ->get();