Mam taki problem wykonuję wszystko jak jest w instrukcji tej https://scotch.io/tutorials/laravel-social-authentication-with-socialite i dostaje taki komunikat
The use statement with non-compound name 'Auth' has no effect
nie wiem tylko co wpisać w pole w pliku env w pola
FACEBOOK_ID=1234//tutaj chyba się wpisuje id z facebooka ?
FACEBOOK_SECRET=test //tutaj nie wiem
FACEBOOK_URL=test //tutaj też nie wiem
No i daje kod controllera.
<?php
use Auth;
use Socialite;
use Blog\Article;
class AuthController extends Controller
{
// Some methods which were generated with the app
/**
* Redirect the user to the OAuth Provider.
*
* @return Response
*/
public function redirectToProvider($provider)
{
return Socialite::driver($provider)->redirect();
}
/**
* Obtain the user information from provider. Check if the user already exists in our
* database by looking up their provider_id in the database.
* If the user exists, log them in. Otherwise, create a new user then log them in. After that
* redirect them to the authenticated users homepage.
*
* @return Response
*/
public function handleProviderCallback($provider)
{
$user = Socialite::driver($provider)->user();
$authUser = $this->findOrCreateUser($user, $provider);
Auth::login($authUser, true);
return redirect($this->redirectTo);
}
/**
* If a user has registered before using social auth, return the user
* else, create a new user object.
* @param $user Socialite user object
* @param $provider Social auth provider
* @return User
*/
public function findOrCreateUser($user, $provider)
{
$authUser = User::where('provider_id', $user->id)->first();
if ($authUser) {
return $authUser;
}
return User::create([
'name' => $user->name,
'email' => $user->email,
'provider' => $provider,
'provider_id' => $user->id
]);
}
}
?>