From ee3dbf58f1870ffee9307453b1eb9cc406c8ed4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Sun, 19 Dec 2021 11:32:45 +0900 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=E3=83=91=E3=82=B9=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=AE=E5=8D=8A=E8=A7=92=E6=95=B0=E3=81=AE=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=8C=E4=BF=AE=E6=AD=A3=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=E3=81=8B=E3=81=A8=E6=80=9D?= =?UTF-8?q?=E3=81=84=E3=81=BE=E3=81=99=E3=80=82=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/AuthenticationTrait.php | 2 +- .../Controllers/Api/ChildrenController.php | 4 ++-- .../Controllers/Api/FathersController.php | 4 ++-- backend/app/Rules/Hankaku.php | 19 +++++++++++++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 backend/app/Rules/Hankaku.php diff --git a/backend/app/Http/Controllers/Api/AuthenticationTrait.php b/backend/app/Http/Controllers/Api/AuthenticationTrait.php index ab312b68..3c306b26 100644 --- a/backend/app/Http/Controllers/Api/AuthenticationTrait.php +++ b/backend/app/Http/Controllers/Api/AuthenticationTrait.php @@ -36,7 +36,7 @@ trait AuthenticationTrait { $validate = Validator::make($r->all(), [ $chk[0] => 'required|'.$chk[2], - 'password' => 'required|min:8|max:72|alpha_num', + 'password' => ['required', 'min:8', 'max:72', new \App\Rules\Hankaku], ]); // バリデーションエラー diff --git a/backend/app/Http/Controllers/Api/ChildrenController.php b/backend/app/Http/Controllers/Api/ChildrenController.php index ce6af06d..10b693e3 100644 --- a/backend/app/Http/Controllers/Api/ChildrenController.php +++ b/backend/app/Http/Controllers/Api/ChildrenController.php @@ -126,7 +126,7 @@ class ChildrenController extends Controller { $validate = Validator::make($r->all(), [ 'identity' => 'required|max:20|alpha_num', 'email' => 'required|unique:children|max:255|email', - 'password' => 'required|min:8|max:72|confirmed|alpha_num', + 'password' => ['required', 'min:8', 'max:72', 'confirmed', new \App\Rules\Hankaku], 'last_name' => 'required|max:100', 'first_name' => 'required|max:100', 'image' => 'image_size|image_meme', @@ -529,7 +529,7 @@ class ChildrenController extends Controller { // バリデーションエラー $validate = Validator::make($r->all(), [ - 'password' => 'required|min:8|max:72|confirmed|alpha_num', + 'password' => ['required', 'min:8', 'max:72', 'confirmed', new \App\Rules\Hankaku], ]); if ($validate->fails()) { diff --git a/backend/app/Http/Controllers/Api/FathersController.php b/backend/app/Http/Controllers/Api/FathersController.php index 8561db3f..ce4e9f2d 100644 --- a/backend/app/Http/Controllers/Api/FathersController.php +++ b/backend/app/Http/Controllers/Api/FathersController.php @@ -167,7 +167,7 @@ class FathersController extends Controller { $validate = Validator::make($r->all(), [ 'token' => 'required', - 'password' => 'required|min:8|max:72|confirmed|alpha_num', + 'password' => ['required', 'min:8', 'max:72', 'confirmed', new \App\Rules\Hankaku], 'company' => 'required|max:100', 'image' => 'image_size|image_meme', 'profile' => 'max:1000', @@ -479,7 +479,7 @@ class FathersController extends Controller { // バリデーションエラー $validate = Validator::make($r->all(), [ - 'password' => 'required|min:8|max:72|confirmed|alpha_num', + 'password' => ['required', 'min:8', 'max:72', 'confirmed', new \App\Rules\Hankaku], ]); if ($validate->fails()) { diff --git a/backend/app/Rules/Hankaku.php b/backend/app/Rules/Hankaku.php new file mode 100644 index 00000000..511a70f6 --- /dev/null +++ b/backend/app/Rules/Hankaku.php @@ -0,0 +1,19 @@ +