lasthourcloud/app/Http/Middleware/IsBoardingFlow.php

25 lines
599 B
PHP
Raw Normal View History

2023-08-22 15:44:49 +00:00
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class IsBoardingFlow
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
2023-08-24 14:14:09 +00:00
ray('IsBoardingFlow Middleware');
if (showBoarding() && !in_array($request->path(), allowedPaths())) {
2023-08-22 15:44:49 +00:00
return redirect('boarding');
}
return $next($request);
}
}