From fc567e0b9af3a17ccb17903b14714694581014db Mon Sep 17 00:00:00 2001 From: Riekelt Kapitein Date: Tue, 10 Dec 2019 13:00:42 +0100 Subject: [PATCH] Model was undefined --- src/Services/ImpersonateManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Services/ImpersonateManager.php b/src/Services/ImpersonateManager.php index 6d6c6d7..5c4f5fe 100644 --- a/src/Services/ImpersonateManager.php +++ b/src/Services/ImpersonateManager.php @@ -41,6 +41,8 @@ public function findUserById($id, $guardName = null) $userProvider = $this->app['auth']->createUserProvider($providerName); if (!($modelInstance = $userProvider->retrieveById($id))) { + $model = $this->app['config']->get("auth.providers.$providerName.model"); + throw (new ModelNotFoundException())->setModel( $model, $id