laravel-like-comment
laravel-like-comment copied to clipboard
problem with avatar in the comment
how to show the avatar of user in the comments . i changed in the function getAuthor but the avatar not shown in the comment public static function getAuthor($id) { $user = self::find($id); $info=[ 'id' => $user->id, 'name' => $user->name, 'email' => $user->email, 'url' => '', // Optional 'avatar' => 'gravatar', // Default avatar 'admin' => $user->role === 'admin', // bool ];
if ($user->facebook_id)
{
$info['avatar']=$user->avatar;
}else{
$info['avatar']=asset('avatar/'.$user->avatar);
}
return $info;
}