mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update AvatarController
This commit is contained in:
parent
5cec84f8e3
commit
0b9a5a26ad
2 changed files with 2 additions and 1 deletions
|
@ -15,6 +15,7 @@ class Avatar extends Model
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $dates = ['deleted_at'];
|
protected $dates = ['deleted_at'];
|
||||||
|
protected $fillable = ['profile_id'];
|
||||||
|
|
||||||
public function profile()
|
public function profile()
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,7 @@ class AvatarController extends Controller
|
||||||
$currentAvatar = storage_path('app/'.$profile->avatar->media_path);
|
$currentAvatar = storage_path('app/'.$profile->avatar->media_path);
|
||||||
$loc = $request->file('avatar')->storeAs($public, $name);
|
$loc = $request->file('avatar')->storeAs($public, $name);
|
||||||
|
|
||||||
$avatar = Avatar::whereProfileId($profile->id)->firstOrFail();
|
$avatar = Avatar::firstOrNew(['profile_id' => $profile->id]);
|
||||||
$opath = $avatar->media_path;
|
$opath = $avatar->media_path;
|
||||||
$avatar->media_path = "$public/$name";
|
$avatar->media_path = "$public/$name";
|
||||||
$avatar->thumb_path = null;
|
$avatar->thumb_path = null;
|
||||||
|
|
Loading…
Reference in a new issue