File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace App \Providers ;
44
5+ use Carbon \CarbonImmutable ;
6+ use Illuminate \Support \Facades \Date ;
7+ use Illuminate \Support \Facades \DB ;
58use Illuminate \Support \ServiceProvider ;
9+ use Illuminate \Validation \Rules \Password ;
610
711class AppServiceProvider extends ServiceProvider
812{
@@ -19,6 +23,25 @@ public function register(): void
1923 */
2024 public function boot (): void
2125 {
22- //
26+ $ this ->configureDefaults ();
27+ }
28+
29+ protected function configureDefaults (): void
30+ {
31+ Date::use (CarbonImmutable::class);
32+
33+ DB ::prohibitDestructiveCommands (
34+ app ()->isProduction (),
35+ );
36+
37+ Password::defaults (fn (): ?Password => app ()->isProduction ()
38+ ? Password::min (12 )
39+ ->mixedCase ()
40+ ->letters ()
41+ ->numbers ()
42+ ->symbols ()
43+ ->uncompromised ()
44+ : null
45+ );
2346 }
2447}
You can’t perform that action at this time.
0 commit comments