AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

AppServiceProvider.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Providers;
  3. use App\Commerce\Payments\PaymentGateway;
  4. use App\Commerce\Payments\StripeGateway;
  5. use Carbon\CarbonImmutable;
  6. use Illuminate\Support\Facades\Date;
  7. use Illuminate\Support\Facades\DB;
  8. use Illuminate\Support\ServiceProvider;
  9. use Illuminate\Validation\Rules\Password;
  10. class AppServiceProvider extends ServiceProvider
  11. {
  12. /**
  13. * Register any application services.
  14. */
  15. public function register(): void
  16. {
  17. // Payments go through one interface, so the provider can be changed in one place.
  18. $this->app->bind(PaymentGateway::class, StripeGateway::class);
  19. }
  20. /**
  21. * Bootstrap any application services.
  22. */
  23. public function boot(): void
  24. {
  25. $this->configureDefaults();
  26. }
  27. /**
  28. * Configure default behaviors for production-ready applications.
  29. */
  30. protected function configureDefaults(): void
  31. {
  32. Date::use(CarbonImmutable::class);
  33. DB::prohibitDestructiveCommands(
  34. app()->isProduction(),
  35. );
  36. Password::defaults(fn (): ?Password => app()->isProduction()
  37. ? Password::min(12)
  38. ->mixedCase()
  39. ->letters()
  40. ->numbers()
  41. ->symbols()
  42. ->uncompromised()
  43. : null,
  44. );
  45. }
  46. }