From 3269ad734a545d1e46437ab13bccbc9b68641566 Mon Sep 17 00:00:00 2001 From: Clayton Stone Date: Thu, 31 Aug 2017 15:53:26 -0500 Subject: [PATCH] setModel parameter should be the string model name In all other cases throughout the framework where setModel is called on ModelNotFoundException, the string name of the model is passed. Here, in ImplicitRouteBinding, a ReflectionClass object is passed. Before: When calling 'getModel' on the exception object, a ReflectionClass object will be returned. After: $exception->getModel will return the string name of the model, just as it does elsewhere in the framework. --- src/Illuminate/Routing/ImplicitRouteBinding.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Routing/ImplicitRouteBinding.php b/src/Illuminate/Routing/ImplicitRouteBinding.php index 5c5eab273246..cf958806a210 100644 --- a/src/Illuminate/Routing/ImplicitRouteBinding.php +++ b/src/Illuminate/Routing/ImplicitRouteBinding.php @@ -33,7 +33,7 @@ public static function resolveForRoute($container, $route) $instance = $container->make($parameter->getClass()->name); if (! $model = $instance->resolveRouteBinding($parameterValue)) { - throw (new ModelNotFoundException)->setModel($parameter->getClass()); + throw (new ModelNotFoundException)->setModel($parameter->getClass()->name); } $route->setParameter($parameterName, $model);