This commit is contained in:
spencerrlongg 2025-02-24 22:35:47 -06:00
parent 27a7c6fd10
commit d949a9689f
4 changed files with 7 additions and 7 deletions

View file

@ -71,12 +71,12 @@ class AssetFilesController extends Controller
try {
return StorageHelper::showOrDownloadFile($file, $log->filename);
} catch (\Exception $e) {
return redirect()->route('hardware.show', ['hardware' => $asset])->with('error', trans('general.file_not_found'));
return redirect()->route('hardware.show', $asset)->with('error', trans('general.file_not_found'));
}
}
return redirect()->route('hardware.show', ['hardware' => $asset])->with('error', trans('general.log_record_not_found'));
return redirect()->route('hardware.show', $asset)->with('error', trans('general.log_record_not_found'));
}
@ -102,7 +102,7 @@ class AssetFilesController extends Controller
return redirect()->back()->withFragment('files')->with('success', trans('admin/hardware/message.deletefile.success'));
}
return redirect()->route('hardware.show', ['hardware' => $asset])->with('error', trans('general.log_record_not_found'));
return redirect()->route('hardware.show', $asset)->with('error', trans('general.log_record_not_found'));
}
}

View file

@ -141,7 +141,7 @@ class Label implements View
break;
case 'hardware_id':
default:
$barcode2DTarget = route('hardware.show', ['hardware' => $asset->id]);
$barcode2DTarget = route('hardware.show', $asset);
break;
}
$assetData->put('barcode2d', (object)[

View file

@ -10,7 +10,7 @@
@php
$checkin = Helper::getFormattedDateObject($asset->expected_checkin, 'date');
@endphp
| [{{ $asset->present()->name }}]({{ route('hardware.show', ['asset' => $asset]) }}) | [{{ $asset->assignedTo->present()->fullName }}]({{ route($asset->targetShowRoute().'.show', [$asset->assignedTo->id]) }}) | {{ $checkin['formatted'] }}
| [{{ $asset->present()->name }}]({{ route('hardware.show', $asset) }}) | [{{ $asset->assignedTo->present()->fullName }}]({{ route($asset->targetShowRoute().'.show', [$asset->assignedTo->id]) }}) | {{ $checkin['formatted'] }}
@endforeach
@endcomponent

View file

@ -126,7 +126,7 @@ Route::group(
// Redirect old legacy /asset_id/view urls to the resource route version
Route::get('{assetId}/view', function ($assetId) {
return redirect()->route('hardware.show', ['hardware' => $assetId]);
return redirect()->route('hardware.show', $assetId);
});
Route::get('{asset}/qr_code',