mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-05 06:55:34 +00:00
added more eager loading
This commit is contained in:
@ -491,7 +491,18 @@ class AssetsController extends Controller
|
||||
public function showBySerial(Request $request, $serial): JsonResponse | array
|
||||
{
|
||||
$this->authorize('index', Asset::class);
|
||||
$assets = Asset::where('serial', $serial)->with('assetstatus')->with('assignedTo');
|
||||
$assets = Asset::where('serial', $serial)->with([
|
||||
'assetstatus',
|
||||
'assignedTo',
|
||||
'company',
|
||||
'defaultLoc',
|
||||
'location',
|
||||
'model.category',
|
||||
'model.depreciation',
|
||||
'model.fieldset',
|
||||
'model.manufacturer',
|
||||
'supplier',
|
||||
]);
|
||||
|
||||
// Check if they've passed ?deleted=true
|
||||
if ($request->input('deleted', 'false') == 'true') {
|
||||
|
||||
Reference in New Issue
Block a user