@@ -182,7 +182,7 @@ public function handleShowAction($id, $request = null, array $extraParams = [])
182
182
$ this ->qualifyItemQuery ();
183
183
184
184
try {
185
- $ item = $ this ->builder ->find ($ id , $ fields );
185
+ $ item = $ this ->builder ->findOrFail ($ id , $ fields );
186
186
$ this ->authoriseUserAction ('view ' , $ item );
187
187
} catch (ModelNotFoundException $ exception ) {
188
188
return $ this ->errorNotFound ('Record not found ' );
@@ -206,7 +206,7 @@ public function handleUpdateAction($id, $request, array $extraParams = [])
206
206
$ this ->handleCommonActions ($ request );
207
207
208
208
try {
209
- $ item = $ this ->builder ->find ($ id );
209
+ $ item = $ this ->builder ->findOrFail ($ id );
210
210
$ this ->authoriseUserAction ('update ' , $ item );
211
211
} catch (ModelNotFoundException $ exception ) {
212
212
return $ this ->errorNotFound ('Record does not exist ' );
@@ -256,7 +256,7 @@ public function handleDestroyAction($id, $request = null)
256
256
$ this ->qualifyItemQuery ();
257
257
258
258
try {
259
- $ item = $ this ->builder ->find ($ id );
259
+ $ item = $ this ->builder ->findOrFail ($ id );
260
260
$ this ->authoriseUserAction ('delete ' , $ item );
261
261
$ item ->delete ();
262
262
} catch (ModelNotFoundException $ exception ) {
0 commit comments