wip: boarding
This commit is contained in:
28
app/Http/Middleware/IsBoardingFlow.php
Normal file
28
app/Http/Middleware/IsBoardingFlow.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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
|
||||
{
|
||||
$allowed_paths = [
|
||||
'subscription',
|
||||
'boarding',
|
||||
'livewire/message/boarding'
|
||||
];
|
||||
if (showBoarding() && !in_array($request->path(), $allowed_paths)) {
|
||||
return redirect('boarding');
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user