From d2dadc977f2caaf2a371d8c900ebd4c8ff0b84c0 Mon Sep 17 00:00:00 2001 From: Darmen Amanbayev Date: Tue, 22 Jan 2019 23:20:22 +0100 Subject: [PATCH] Add more user-friendly error message --- src/Http/OrderFieldRequestHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http/OrderFieldRequestHandler.php b/src/Http/OrderFieldRequestHandler.php index aa500fd..f371429 100644 --- a/src/Http/OrderFieldRequestHandler.php +++ b/src/Http/OrderFieldRequestHandler.php @@ -17,7 +17,7 @@ public function __invoke(NovaRequest $request) $model = $request->findModelOrFail($resourceId); if (!$model instanceof Sortable) { - abort(500); + abort(500, "Model should implement " . Sortable::class . " interface"); } $direction = $request->get('direction'); @@ -28,4 +28,4 @@ public function __invoke(NovaRequest $request) $model->moveOrderDown(); } } -} \ No newline at end of file +}