Laravel:Jetstream User登録のValidation
by itsagent
投稿日: 2022年4月8日16:18
use App\Rules\Zenkakurule;
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'kana' => ['required', 'string', 'max:255',new Zenkakurule],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => $this->passwordRules(),
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
])->validate();
app\Actions\FortifyのCreateNewUser.php
全角カナの入力ルールもこれらのphpに設定可能。
bladeは、\resources\views\authのregister.blade.php。