AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use App\Http\Middleware\HandleAppearance;
  3. use App\Http\Middleware\HandleInertiaRequests;
  4. use Illuminate\Foundation\Application;
  5. use Illuminate\Foundation\Configuration\Exceptions;
  6. use Illuminate\Foundation\Configuration\Middleware;
  7. use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;
  8. use Illuminate\Http\Request;
  9. $app = Application::configure(basePath: dirname(__DIR__))
  10. ->withRouting(
  11. web: __DIR__.'/../routes/web.php',
  12. commands: __DIR__.'/../routes/console.php',
  13. health: '/up',
  14. )
  15. ->withMiddleware(function (Middleware $middleware): void {
  16. $middleware->encryptCookies(except: ['appearance', 'sidebar_state']);
  17. // Stripe cannot send our form-protection token. Its messages are checked by signature instead.
  18. $middleware->validateCsrfTokens(except: ['stripe/webhook']);
  19. $middleware->web(append: [
  20. HandleAppearance::class,
  21. HandleInertiaRequests::class,
  22. AddLinkHeadersForPreloadedAssets::class,
  23. ]);
  24. })
  25. ->withExceptions(function (Exceptions $exceptions): void {
  26. $exceptions->shouldRenderJsonWhen(
  27. fn (Request $request) => $request->is('api/*') || $request->expectsJson(),
  28. );
  29. })->create();
  30. // Development settings live in .env.local (never uploaded to the repository).
  31. // When that file exists it is used instead of .env, which holds only basic, non-secret settings.
  32. if (is_file($app->environmentPath().'/.env.local')) {
  33. $app->loadEnvironmentFrom('.env.local');
  34. }
  35. return $app;