mirror of
https://github.com/flarum/framework.git
synced 2025-06-03 22:43:10 +08:00
Finish client action refactoring. closes flarum/core#126
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
<?php namespace Flarum\Core\Users;
|
||||
|
||||
use Flarum\Core;
|
||||
use Flarum\Core\Groups\Group;
|
||||
use Flarum\Core\Model;
|
||||
use Flarum\Core\Notifications\Notification;
|
||||
@ -282,7 +283,21 @@ class User extends Model
|
||||
*/
|
||||
public function getAvatarUrlAttribute()
|
||||
{
|
||||
return $this->avatar_path ? app('Flarum\Http\UrlGeneratorInterface')->toAsset('assets/avatars/'.$this->avatar_path) : null;
|
||||
$urlGenerator = app('Flarum\Http\UrlGeneratorInterface');
|
||||
|
||||
return $this->avatar_path ? $urlGenerator->toAsset('assets/avatars/'.$this->avatar_path) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user's locale, falling back to the forum's default if they
|
||||
* haven't set one.
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
public function getLocaleAttribute($value)
|
||||
{
|
||||
return $value ?: Core::config('locale', 'en');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user