Skip to content

Commit 8a40c3e

Browse files
authored
Merge pull request #16325 from spencerrlongg/bug/sc-28520
Remove remaining hardware references in favor of new RMB
2 parents 27a7c6f + d949a96 commit 8a40c3e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

app/Http/Controllers/Assets/AssetFilesController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ public function show(Asset $asset, $fileId = null) : View | RedirectResponse | R
7171
try {
7272
return StorageHelper::showOrDownloadFile($file, $log->filename);
7373
} catch (\Exception $e) {
74-
return redirect()->route('hardware.show', ['hardware' => $asset])->with('error', trans('general.file_not_found'));
74+
return redirect()->route('hardware.show', $asset)->with('error', trans('general.file_not_found'));
7575
}
7676

7777
}
7878

79-
return redirect()->route('hardware.show', ['hardware' => $asset])->with('error', trans('general.log_record_not_found'));
79+
return redirect()->route('hardware.show', $asset)->with('error', trans('general.log_record_not_found'));
8080

8181

8282
}
@@ -102,7 +102,7 @@ public function destroy(Asset $asset, $fileId = null) : RedirectResponse
102102
return redirect()->back()->withFragment('files')->with('success', trans('admin/hardware/message.deletefile.success'));
103103
}
104104

105-
return redirect()->route('hardware.show', ['hardware' => $asset])->with('error', trans('general.log_record_not_found'));
105+
return redirect()->route('hardware.show', $asset)->with('error', trans('general.log_record_not_found'));
106106
}
107107

108108
}

app/View/Label.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ public function render(callable $callback = null)
140140
$barcode2DTarget = $asset->serial;
141141
break;
142142
case 'hardware_id':
143-
default:
144-
$barcode2DTarget = route('hardware.show', ['hardware' => $asset->id]);
143+
default:
144+
$barcode2DTarget = route('hardware.show', $asset);
145145
break;
146146
}
147147
$assetData->put('barcode2d', (object)[

resources/views/notifications/markdown/report-expected-checkins.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@php
1111
$checkin = Helper::getFormattedDateObject($asset->expected_checkin, 'date');
1212
@endphp
13-
| [{{ $asset->present()->name }}]({{ route('hardware.show', ['asset' => $asset]) }}) | [{{ $asset->assignedTo->present()->fullName }}]({{ route($asset->targetShowRoute().'.show', [$asset->assignedTo->id]) }}) | {{ $checkin['formatted'] }}
13+
| [{{ $asset->present()->name }}]({{ route('hardware.show', $asset) }}) | [{{ $asset->assignedTo->present()->fullName }}]({{ route($asset->targetShowRoute().'.show', [$asset->assignedTo->id]) }}) | {{ $checkin['formatted'] }}
1414
@endforeach
1515
@endcomponent
1616

routes/web/hardware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function () {
126126

127127
// Redirect old legacy /asset_id/view urls to the resource route version
128128
Route::get('{assetId}/view', function ($assetId) {
129-
return redirect()->route('hardware.show', ['hardware' => $assetId]);
129+
return redirect()->route('hardware.show', $assetId);
130130
});
131131

132132
Route::get('{asset}/qr_code',

0 commit comments

Comments
 (0)