1
0
mirror of https://github.com/flarum/core.git synced 2025-07-25 18:51:40 +02:00

Change name of avatar field in users table.

This commit is contained in:
Franz Liedke
2015-03-26 20:59:06 +01:00
parent ab9cf922db
commit cf8e02977f
3 changed files with 10 additions and 4 deletions

View File

@@ -46,7 +46,7 @@ class UploadAvatarCommandHandler
'target' => $this->uploadDir,
]);
$user->changeAvatarUrl($uploadName);
$user->changeAvatarPath($uploadName);
event(new AvatarWillBeUploaded($user, $command));

View File

@@ -211,9 +211,15 @@ class User extends Model
return $this;
}
public function changeAvatarUrl($url)
/**
* Change the path of the user avatar.
*
* @param string $path
* @return $this
*/
public function changeAvatarPath($path)
{
$this->avatar = $url;
$this->avatar_path = $path;
$this->raise(new UserAvatarWasChanged($this));