app.php 634 B

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