Getting the following error when using Socialite to authenticate with Facebook. Using Laravel 5.2 and this is the first time I am trying to implement Socialite. Any ideas ?
FatalErrorException in AbstractProvider.php line 134:
Call to a member function set() on a non-object
Route :-
Route::get('/login', 'AuthController@login');
AuthController.php :-
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class AuthController extends Controller
{
public function login()
{
return \Socialite::with('facebook')->redirect();
}
}
services.php setup as follows with details in the .env file :-
'facebook' => [
'client_id' => env('FACEBOOK_CLIENT_ID'),
'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
'redirect' => env('FACEBOOK_REDIRECT'),
],
The same error was reported here but no response :- https://laracasts.com/discuss/channels/laravel/laravel-socialite-session-errors-in-52/replies/125233