laravelista / comments

Native comments for your Laravel application.
MIT License
744 stars 142 forks source link

Profile picture #109

Closed vitorhenriquemaia closed 4 years ago

vitorhenriquemaia commented 4 years ago

Hey, the package is awesome!! Thanks for sharing. It is not a Issue I just need a hand. I am trying to use the avatar from my project instead gravatar. passing this <img src="{{asset('/uploads/avatar')}}/{{$user->avatar}}" alt="avatar">

but it is returning this:

$user is undefined Make the variable optional in the blade template. Replace {{ $user }} with {{ $user ?? '' }}

ps:I will remove that "issue" after fix it.

Thank for your time.

mabasic commented 4 years ago

Thank you very much :)

Take a look here: https://github.com/laravelista/comments/blob/master/resources/views/_comment.blade.php#L9

All you need to do is publish the views for customization (see readme for this), and modify the line in the link above to match the thing you want. You probably want these variable $comment->commenter->email ?? $comment->guest_email.

Let me know if you solve this.

vitorhenriquemaia commented 4 years ago

I already publish the views and remove the gravatar image and set this <img src="{{asset('/uploads/avatar')}}/{{$user->avatar}}" alt="avatar"> and it is returning this:

$user is undefined Make the variable optional in the blade template. Replace {{ $user }} with {{ $user ?? '' }}

I don't know what is happening.

mabasic commented 4 years ago
<img src="{{asset('/uploads/avatar')}}/{{$comment->commenter->avatar}}" alt="avatar">

$user is $comment->commenter.

vitorhenriquemaia commented 4 years ago

Thank you very much! It is working now!

vitorhenriquemaia commented 4 years ago

Should I close the "Issue" or may I keep it for others users?

mabasic commented 4 years ago

Even if closed it can be found when searching the issues in the future.