diff --git a/src/Http/Controllers/SocialController.php b/src/Http/Controllers/SocialController.php index 2c699f7..0050bf5 100644 --- a/src/Http/Controllers/SocialController.php +++ b/src/Http/Controllers/SocialController.php @@ -4,7 +4,6 @@ use Devdojo\Auth\Models\SocialProvider; use Devdojo\Auth\Models\SocialProviderUser; -use Devdojo\Auth\Models\User; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Config; @@ -76,7 +75,7 @@ private function findOrCreateProviderUser($socialiteUser, $driver) return $providerUser; } - $user = User::where('email', $socialiteUser->getEmail())->first(); + $user = app(config('auth.providers.users.model'))->where('email', $socialiteUser->getEmail())->first(); if ($user) { $existingProvider = $user->socialProviders()->first(); @@ -95,7 +94,7 @@ private function findOrCreateProviderUser($socialiteUser, $driver) private function createUser($socialiteUser) { - return User::create([ + return app(config('auth.providers.users.model'))->create([ 'name' => $socialiteUser->getName(), 'email' => $socialiteUser->getEmail(), 'email_verified_at' => now(),