Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

with in laravel

Post::query()
    ->with(['user' => function ($query) {
        $query->select('id', 'username');
    }])
    ->get();

$users = AppBook::with('author:id,name')->get();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel
ADD COMMENT
Topic
Name
1+3 =