mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 06:39:40 +08:00
Change name of avatar field in users table.
This commit is contained in:
parent
26146f1417
commit
e5973aa161
@ -23,7 +23,7 @@ class CreateUsersTable extends Migration {
|
||||
$table->string('password');
|
||||
$table->text('bio')->nullable();
|
||||
$table->text('bio_html')->nullable();
|
||||
$table->string('avatar')->nullable();
|
||||
$table->string('avatar_path')->nullable();
|
||||
$table->dateTime('join_time')->nullable();
|
||||
$table->dateTime('last_seen_time')->nullable();
|
||||
$table->dateTime('read_time')->nullable();
|
||||
|
@ -46,7 +46,7 @@ class UploadAvatarCommandHandler
|
||||
'target' => $this->uploadDir,
|
||||
]);
|
||||
|
||||
$user->changeAvatarUrl($uploadName);
|
||||
$user->changeAvatarPath($uploadName);
|
||||
|
||||
event(new AvatarWillBeUploaded($user, $command));
|
||||
|
||||
|
@ -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));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user