laravel merge two query builder

Solutions on MaxInterview for laravel merge two query builder by the best coders in the world

showing results for - "laravel merge two query builder"
Faustine
02 Nov 2017
1$page = Page::select('id as page_id','name_en as page_name');
2        $data['permissions'] = Permission::where('role_id', $id)->joinSub($page,'permissions_page',function($join){
3            $join->on('permissions.page_id','=','permissions_page.page_id');
4        })->get();