mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -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([
|
$departments = Department::select([
|
||||||
'id',
|
'id',
|
||||||
'name',
|
'name',
|
||||||
'location_id'
|
'location_id',
|
||||||
])->with('users')->withCount('users');
|
'manager_id'
|
||||||
|
])->with('users')->with('location')->with('manager')->withCount('users');
|
||||||
|
|
||||||
if ($request->has('search')) {
|
if ($request->has('search')) {
|
||||||
$departments = $departments->TextSearch($request->input('search'));
|
$departments = $departments->TextSearch($request->input('search'));
|
||||||
|
|
Loading…
Reference in a new issue