mirror of
https://github.com/flarum/core.git
synced 2025-07-30 13:10:24 +02:00
Add avatar handling to user model.
This commit is contained in:
@@ -10,6 +10,7 @@ use Flarum\Core\Events\UserWasRenamed;
|
||||
use Flarum\Core\Events\UserEmailWasChanged;
|
||||
use Flarum\Core\Events\UserPasswordWasChanged;
|
||||
use Flarum\Core\Events\UserBioWasChanged;
|
||||
use Flarum\Core\Events\UserAvatarWasChanged;
|
||||
use Flarum\Core\Events\UserWasActivated;
|
||||
use Flarum\Core\Events\UserEmailWasConfirmed;
|
||||
|
||||
@@ -210,6 +211,15 @@ class User extends Model
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function changeAvatarUrl($url)
|
||||
{
|
||||
$this->avatar = $url;
|
||||
|
||||
$this->raise(new UserAvatarWasChanged($this));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given password matches the user's password.
|
||||
*
|
||||
|
Reference in New Issue
Block a user