実現したいこと
fortifyにおいてのPassword::default()の定義場所を知りたい。
発生している問題・分からないこと
通常ならサービスプロバイダの1つのbootメソッド内で呼び出すと思うのですが
fortifyでは初めから Password::default()
が実装されていると思われます。
ですがProvidersディレクトリの中のファイルには定義されていないと思います。
該当のソースコード
PasswordValidationRules.php
1<?php 2 3namespace App\Actions\Fortify; 4 5use Illuminate\Validation\Rules\Password; 6 7trait PasswordValidationRules 8{ 9 /** 10 * Get the validation rules used to validate passwords. 11 * 12 * @return array<int, \Illuminate\Contracts\Validation\Rule|array|string> 13 */ 14 protected function passwordRules(): array 15 { 16 return ['required', 'string', Password::default(), 'max:191', 'confirmed']; 17 } 18}
AppServiceProvider.php
1<?php 2 3namespace App\Providers; 4 5use Illuminate\Support\ServiceProvider; 6 7class AppServiceProvider extends ServiceProvider 8{ 9 /** 10 * Register any application services. 11 * 12 * @return void 13 */ 14 public function register() 15 { 16 // 17 } 18 19 /** 20 * Bootstrap any application services. 21 * 22 * @return void 23 */ 24 public function boot() 25 { 26 // 27 } 28} 29
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
検索はもちろん、ドキュメント等を読んでみましたがわかりませんでした。
補足
まだまだプログラミングの勉強歴が浅いので、内容に不備があればご指摘お願い致します。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2023/12/28 08:07