From f9c4bd9b5af8c3285842515b5659ef03f21a66d2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 3 Jul 2018 21:45:17 +0200 Subject: Ajax instead of form for avatar post. --- app/Http/Controllers/UserController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/Http') diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index d82ee98..2cfbea7 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -27,7 +27,6 @@ class UserController extends Controller Storage::put('avatars/' . $avatarName, (string) $fittedAvatar); $user->avatar = $avatarName; $user->save(); - return back() - ->with('success', 'You have successfully uploaded the avatar.'); + return response()->json(array('success'=>'You have successfully uploaded the avatar.')); } } -- cgit v1.2.3