diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index d4ff0092ba..bad1947966 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -463,7 +463,7 @@ class AssetsController extends Controller { $this->authorize('view', Asset::class); $this->authorize('view', License::class); - $asset = Asset::where('id', $id)->withTrashed()->first(); + $asset = Asset::where('id', $id)->withTrashed()->firstorfail(); $licenses = $asset->licenses()->get(); return (new LicensesTransformer())->transformLicenses($licenses, $licenses->count());