app.php 883 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. use Illuminate\Foundation\Application;
  3. use Illuminate\Foundation\Configuration\Exceptions;
  4. use Illuminate\Foundation\Configuration\Middleware;
  5. use Illuminate\Console\Scheduling\Schedule;
  6. use App\Http\Middleware\SetUserLanguage;
  7. use App\Tasks\DeleteExpiredTokens;
  8. return Application::configure(basePath: dirname(__DIR__))
  9. ->withRouting(
  10. web: __DIR__.'/../routes/web.php',
  11. api: __DIR__.'/../routes/api.php',
  12. commands: __DIR__.'/../routes/console.php',
  13. health: '/up',
  14. )
  15. ->withMiddleware(function (Middleware $middleware) {
  16. $middleware->statefulApi();
  17. $middleware->append(SetUserLanguage::class);
  18. })
  19. ->withSchedule(function (Schedule $schedule) {
  20. $schedule->call(new DeleteExpiredTokens)->everyMinute();
  21. })
  22. ->withExceptions(function (Exceptions $exceptions) {
  23. //
  24. })
  25. ->create();