add a warning message if asset tag not found

This commit is contained in:
Florent Bervas 2024-08-05 13:44:26 +00:00
parent b804791ff6
commit ad794248fe

View file

@ -483,7 +483,9 @@ class AssetsController extends Controller
// If not a unique result, redirect to the index view
if ($assets->count() != 1) {
return redirect()->route('hardware.index')->with('search', $tag);
return redirect()->route('hardware.index')
->with('search', $tag)
->with('warning', trans('admin/hardware/message.does_not_exist_var', [ 'asset_tag' => $tag ]));
}
$asset = $assets->first();
$this->authorize('view', $asset);