33namespace Statamic \Http \Controllers \CP \Preferences \Nav ;
44
55use Illuminate \Http \Request ;
6+ use Statamic \Exceptions \NotFoundHttpException ;
67use Statamic \Facades \CP \Nav ;
78use Statamic \Facades \Preference ;
89use Statamic \Facades \Role ;
@@ -23,7 +24,7 @@ protected function ignoreSaveAsOption()
2324
2425 public function edit ($ handle )
2526 {
26- abort_unless ($ role = Role::find ($ handle ), 404 );
27+ throw_unless ($ role = Role::find ($ handle ), new NotFoundHttpException );
2728
2829 $ this ->currentHandle = $ handle ;
2930
@@ -43,7 +44,7 @@ public function edit($handle)
4344
4445 public function update (Request $ request , $ handle )
4546 {
46- abort_unless ($ role = Role::find ($ handle ), 404 );
47+ throw_unless ($ role = Role::find ($ handle ), new NotFoundHttpException );
4748
4849 $ nav = $ this ->getUpdatedNav ($ request );
4950
@@ -58,7 +59,7 @@ public function update(Request $request, $handle)
5859
5960 public function destroy ($ handle )
6061 {
61- abort_unless ($ role = Role::find ($ handle ), 404 );
62+ throw_unless ($ role = Role::find ($ handle ), new NotFoundHttpException );
6263
6364 $ role ->removePreference ('nav ' )->save ();
6465
0 commit comments