Trim model name for display

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-08-17 13:30:28 +01:00
parent 53389875bf
commit e6fec6ec34

View File

@@ -144,7 +144,7 @@ class Handler extends ExceptionHandler
}
// This gets the MVC model name from the exception and formats in a way that's less fugly
$model_name = strtolower(implode(" ", preg_split('/(?=[A-Z])/', last(explode('\\', $e->getModel())))));
$model_name = trim(strtolower(implode(" ", preg_split('/(?=[A-Z])/', last(explode('\\', $e->getModel()))))));
$route = str_plural(strtolower(last(explode('\\', $e->getModel())))).'.index';
// Sigh.