Use UrlGenerator to get avatar URL

This commit is contained in:
Toby Zerner 2015-06-17 12:48:01 +09:30
parent b91ca93e09
commit 61bea371ab

View File

@ -256,7 +256,7 @@ class User extends Model
*/
public function getAvatarUrlAttribute()
{
return $this->avatar_path ? asset('assets/avatars/'.$this->avatar_path) : null;
return $this->avatar_path ? app('Flarum\Http\UrlGeneratorInterface')->toAsset('assets/avatars/'.$this->avatar_path) : null;
}
/**