Update AvatarController
This commit is contained in:
parent
5cec84f8e3
commit
0b9a5a26ad
2 changed files with 2 additions and 1 deletions
|
@ -33,7 +33,7 @@ class AvatarController extends Controller
|
|||
$currentAvatar = storage_path('app/'.$profile->avatar->media_path);
|
||||
$loc = $request->file('avatar')->storeAs($public, $name);
|
||||
|
||||
$avatar = Avatar::whereProfileId($profile->id)->firstOrFail();
|
||||
$avatar = Avatar::firstOrNew(['profile_id' => $profile->id]);
|
||||
$opath = $avatar->media_path;
|
||||
$avatar->media_path = "$public/$name";
|
||||
$avatar->thumb_path = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue