I'm trying to implement Socialiate for Laravel 5.5 using this guide https://scotch.io/tutorials/laravel-social-authentication-with-socialite. Data is returned properly from the provider, but I am having trouble defining Use and Namespaces.
With this configuration:
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Socialite;
The result is:
Class 'App\Http\Controllers\Auth\User' not found
Triggered by:
$authUser = User::where('providerId', $user->id)->first();
But, if I add App\User:
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\User;
use Socialite;
The result is:
Class 'App\Http\Controllers\Auth\Auth' not found
Triggered by:
Auth::login($authUser, true);
Any help is much appreciated.
You didnt import Auth
namespace the right way.
The proper namespace is Illuminate\Support\Facades\Auth;
Add use Illuminate\Support\Facades\Auth;
at the top of your class.