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 :- http://ift.tt/1RqLmwS
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1TDDU0t
via IFTTT
Let put all your routes define into web middleware.
RépondreSupprimerBecause we need middleware \Illuminate\Session\Middleware\StartSession to start session