AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

AppServiceProvider.php 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace App\Providers;
  3. use App\Billing\StripeSubscriptionGateway;
  4. use App\Billing\SubscriptionGateway;
  5. use App\Commerce\Payments\MerchantAccounts;
  6. use App\Commerce\Payments\PaymentGateway;
  7. use App\Commerce\Payments\StripeGateway;
  8. use App\Commerce\Payments\StripeMerchantAccounts;
  9. use App\Commerce\Shipping\EasyParcel\EasyParcel;
  10. use App\Commerce\Shipping\FlatRateShipping;
  11. use App\Commerce\Shipping\ShippingProvider;
  12. use Carbon\CarbonImmutable;
  13. use Illuminate\Foundation\DevCommands;
  14. use Illuminate\Support\Facades\Date;
  15. use Illuminate\Support\Facades\DB;
  16. use Illuminate\Support\ServiceProvider;
  17. use Illuminate\Validation\Rules\Password;
  18. class AppServiceProvider extends ServiceProvider
  19. {
  20. /**
  21. * Register any application services.
  22. */
  23. public function register(): void
  24. {
  25. // Payments go through one interface, so the provider can be changed in one place.
  26. $this->app->bind(PaymentGateway::class, StripeGateway::class);
  27. // Merchants' own Stripe accounts (Stripe Connect), where shoppers' payments go.
  28. $this->app->bind(MerchantAccounts::class, StripeMerchantAccounts::class);
  29. $this->app->bind(SubscriptionGateway::class, StripeSubscriptionGateway::class);
  30. $this->app->bind(ShippingProvider::class, FlatRateShipping::class);
  31. $this->app->bind(EasyParcel::class, fn () => EasyParcel::fromConfig());
  32. }
  33. /**
  34. * Bootstrap any application services.
  35. */
  36. public function boot(): void
  37. {
  38. $this->configureDefaults();
  39. // `composer run dev` also runs the scheduler, so the double-check for unpaid orders runs on this machine too.
  40. DevCommands::artisan('schedule:work', 'scheduler');
  41. }
  42. /**
  43. * Configure default behaviors for production-ready applications.
  44. */
  45. protected function configureDefaults(): void
  46. {
  47. Date::use(CarbonImmutable::class);
  48. DB::prohibitDestructiveCommands(
  49. app()->isProduction(),
  50. );
  51. Password::defaults(fn (): ?Password => app()->isProduction()
  52. ? Password::min(12)
  53. ->mixedCase()
  54. ->letters()
  55. ->numbers()
  56. ->symbols()
  57. ->uncompromised()
  58. : null,
  59. );
  60. }
  61. }