What I did:
"laravel/socialite": "~2.0"
to composer.json
composer update
'Laravel\Socialite\SocialiteServiceProvider'
to app.php
'Socialite' => 'Laravel\Socialite\Facades\Socialite'
to app.php
After all this steps I created a new Controller Class which looks like that:
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class AuthController extends Controller {
public function login()
{
return \Socialite::with('facebook')->redirect();
}
}
But i still got this error: PHP Fatal error: Class '\Socialite'
Editcomposer dump-autoload
fixed probably the error, but it's still not working correctly.
In your Controllers file add
use Laravel\Socialite\Facades\Socialite;
Just below use Illuminate\Http\Request;
in your controller add use Socialize;
Check if you have set your alias as "Socialize" as in the Socialite docs says to do this way:
'Socialize' => 'Laravel\Socialite\Facades\Socialite',
It as very confusing to me as well
I had the same issue. Clearing the config cache helped me in this situation:
php artisan config:clear
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With