app.php 797 B

123456789101112131415161718192021222324
  1. <?php
  2. use App\Http\Middleware\CatchTokenFcmMiddleware;
  3. use App\Http\Middleware\EnsureUserHasRole;
  4. use Illuminate\Foundation\Application;
  5. use Illuminate\Foundation\Configuration\Exceptions;
  6. use Illuminate\Foundation\Configuration\Middleware;
  7. return Application::configure(basePath: dirname(__DIR__))
  8. ->withRouting(
  9. web: __DIR__.'/../routes/web.php',
  10. commands: __DIR__.'/../routes/console.php',
  11. channels: __DIR__.'/../routes/channels.php',
  12. health: '/up',
  13. )
  14. ->withMiddleware(function (Middleware $middleware) {
  15. $middleware->alias([
  16. 'role' => EnsureUserHasRole::class,
  17. ]);
  18. $middleware->append(CatchTokenFcmMiddleware::class);
  19. })
  20. ->withExceptions(function (Exceptions $exceptions) {
  21. //
  22. })->create();