diff --git a/src/Helpers/modules_helpers.php b/src/Helpers/modules_helpers.php index a3f119bf7..243b85704 100644 --- a/src/Helpers/modules_helpers.php +++ b/src/Helpers/modules_helpers.php @@ -92,7 +92,7 @@ function getModelController(TwillModelContract $model) if (!class_exists($controller)) { try { - $controller = TwillCapsules::getCapsuleForModel($model)->getControllerClass(); + $controller = TwillCapsules::getCapsuleForModel($modelName)->getControllerClass(); } catch (NoCapsuleFoundException) { throw new Exception($controller . ' not found'); }