Better error handling for qr codes on invalid assets
This commit is contained in:
parent
d1022e8ff7
commit
a3e80882c1
1 changed files with 14 additions and 11 deletions
|
@ -666,6 +666,7 @@ class AssetsController extends Controller
|
|||
|
||||
if ($settings->qr_code == '1') {
|
||||
$asset = Asset::withTrashed()->find($assetId);
|
||||
if ($asset) {
|
||||
$size = Helper::barcodeDimensions($settings->barcode_type);
|
||||
$qr_file = public_path().'/uploads/barcodes/qr-'.str_slug($asset->asset_tag).'-'.str_slug($asset->id).'.png';
|
||||
|
||||
|
@ -681,6 +682,8 @@ class AssetsController extends Controller
|
|||
}
|
||||
}
|
||||
}
|
||||
return 'That asset is invalid';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue