mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update AvatarController
This commit is contained in:
parent
fca4562933
commit
a2641dfc78
1 changed files with 1 additions and 2 deletions
|
@ -30,11 +30,10 @@ class AvatarController extends Controller
|
||||||
$dir = $path['root'];
|
$dir = $path['root'];
|
||||||
$name = $path['name'];
|
$name = $path['name'];
|
||||||
$public = $path['storage'];
|
$public = $path['storage'];
|
||||||
$currentAvatar = storage_path('app/'.$profile->avatar->media_path);
|
|
||||||
$loc = $request->file('avatar')->storeAs($public, $name);
|
$loc = $request->file('avatar')->storeAs($public, $name);
|
||||||
|
|
||||||
$avatar = Avatar::firstOrNew(['profile_id' => $profile->id]);
|
$avatar = Avatar::firstOrNew(['profile_id' => $profile->id]);
|
||||||
$opath = $avatar->media_path;
|
$currentAvatar = $avatar->recentlyCreated ? null : storage_path('app/'.$profile->avatar->media_path);
|
||||||
$avatar->media_path = "$public/$name";
|
$avatar->media_path = "$public/$name";
|
||||||
$avatar->thumb_path = null;
|
$avatar->thumb_path = null;
|
||||||
$avatar->change_count = ++$avatar->change_count;
|
$avatar->change_count = ++$avatar->change_count;
|
||||||
|
|
Loading…
Reference in a new issue