Sid Heart
Sid Heart

Reputation: 743

gravatar won't get my image

i am using this package<

thomaswelton/laravel-gravatar

yes its working good when i use this code

<img src="{{ Gravatar::src('[email protected]') }}" class="img-circle img-responsive">

but its a static image so i trying to change this to dynamic like this

<img src="{{ Gravatar::src('{!! Auth::user()->email !!}') }}" class="img-circle img-responsive">
and 
<img src="{!! Gravatar::src('{{ Auth::user()->email }}') !!}" class="img-circle img-responsive">

this won't work why any solution

Upvotes: 0

Views: 144

Answers (1)

Burak Ozdemir
Burak Ozdemir

Reputation: 5332

The reason that it's not being loaded is actually you are passing the whole {!! Auth::user()->email !!} argument as a string so that it's not being printed as you may think for the static Gravatar src function.

Just pass it like below.

<img src="{{ Gravatar::src(Auth::user()->email) }}" class="img-circle img-responsive">

Upvotes: 1

Related Questions