Waldemar
2 years ago
48
12
Laravel

laravel5/socialite getAvatar()

Posted 2 years ago by Waldemar

Hi! Hello please help me! How i can $user->getAvatar() in view with laravel/socialite Please help me! I am new user laravel.

@if(\Auth::check())
    <li>
        {{ $user->getAvatar() }}
    </li>
@else
    <li>
        <a href="javascript:;" data-toggle="modal" data-target="#login-form" class="c-btn-border-opacity-04 c-btn btn-no-focus c-btn-header btn btn-sm c-btn-border-1x c-btn-white c-btn-circle c-btn-uppercase c-btn-sbold">
                                        <i class="icon-user"></i> Sign In</a>
    </li>
@endif

AND THIS`S my controller

public function callback(Request $request,SocialAccountService $service, $social)
    {

        if($request->error=='access_denied')
        {
            return redirect('/');
        }

        $user = $service->createOrGetUser(Socialite::driver($social)->user(), $social);
        auth()->login($user);

        return redirect('/'));
    }

I need use $user->getAvatar() off all views in my project! How i do wrong? and sory for my english =(

Please sign in or create an account to participate in this conversation.