From 4898dd8e23de5908495c898b179924ce3779bd9e Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 6 Dec 2017 14:42:14 -0800 Subject: [PATCH] Use ImageUploadRequest $request on user profile update --- app/Http/Controllers/ProfileController.php | 3 ++- app/Http/Requests/ImageUploadRequest.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index c76c5f9cf8..72fde2fe9a 100755 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -11,6 +11,7 @@ use App\Models\Setting; use Gate; use Illuminate\Http\Request; use Illuminate\Support\Facades\Hash; +use App\Http\Requests\ImageUploadRequest; /** * This controller handles all actions related to User Profiles for @@ -40,7 +41,7 @@ class ProfileController extends Controller * @since [v1.0] * @return \Illuminate\Http\RedirectResponse */ - public function postIndex() + public function postIndex(ImageUploadRequest $request) { $user = Auth::user(); diff --git a/app/Http/Requests/ImageUploadRequest.php b/app/Http/Requests/ImageUploadRequest.php index 2b8bad20f4..45e45ac3b2 100644 --- a/app/Http/Requests/ImageUploadRequest.php +++ b/app/Http/Requests/ImageUploadRequest.php @@ -24,7 +24,8 @@ class ImageUploadRequest extends Request public function rules() { return [ - 'image' => 'mimes:png,gif,jpg,jpeg,svg|max:2000' + 'image' => 'mimes:png,gif,jpg,jpeg,svg|max:2000', + 'avatar' => 'mimes:png,gif,jpg,jpeg,svg|max:2000', ]; }