Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

query relationships laravel and select some columns

Post::query()
    ->with(array('user' => function($query) {
        $query->select('id','username');
    }))
    ->get();
 
PREVIOUS NEXT
Tagged: #query #relationships #laravel #select #columns
ADD COMMENT
Topic
Name
4+4 =