Skip to content

Commit 32f1132

Browse files
author
Admin
committed
use singular for model not found
1 parent 7d1e1d2 commit 32f1132

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Helpers/GeneralHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Database\Eloquent\ModelNotFoundException;
77
use Illuminate\Database\QueryException;
88
use Illuminate\Support\Facades\Log;
9+
use Illuminate\Support\Str;
910

1011
class GeneralHelper
1112
{
@@ -33,7 +34,7 @@ public static function getSafeErrorMessage(\Throwable $e, string $messagePrefix
3334
}
3435

3536
if ($e instanceof ModelNotFoundException) {
36-
return ($e->getModel()::RESOURCE_NAME ?? 'Resource') . ' not found.';
37+
return Str::singular($e->getModel()::RESOURCE_NAME ?? 'Resource') . ' not found.';
3738
}
3839

3940
return $e->getMessage();

0 commit comments

Comments
 (0)