FleetCart/app/Http/Middleware/RedirectIfInstalled.php

27 lines
488 B
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace FleetCart\Http\Middleware;
use Closure;
2023-12-03 14:07:47 +00:00
use Illuminate\Http\Request;
2023-06-11 12:14:03 +00:00
class RedirectIfInstalled
{
/**
* Handle an incoming request.
*
2023-12-03 14:07:47 +00:00
* @param Request $request
* @param Closure $next
*
2023-06-11 12:14:03 +00:00
* @return mixed
*/
2023-12-03 14:07:47 +00:00
public function handle($request, Closure $next): mixed
2023-06-11 12:14:03 +00:00
{
if (config('app.installed')) {
return redirect()->route('home');
}
return $next($request);
}
}