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.5KB

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