mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Load relationships in query
This commit is contained in:
parent
eb3aa99e4f
commit
bb323db685
|
@ -26,8 +26,9 @@ class DepartmentsController extends Controller
|
|||
$departments = Department::select([
|
||||
'id',
|
||||
'name',
|
||||
'location_id'
|
||||
])->with('users')->withCount('users');
|
||||
'location_id',
|
||||
'manager_id'
|
||||
])->with('users')->with('location')->with('manager')->withCount('users');
|
||||
|
||||
if ($request->has('search')) {
|
||||
$departments = $departments->TextSearch($request->input('search'));
|
||||
|
|
Loading…
Reference in a new issue