Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

with in laravel

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

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