FleetCart/app/Http/Middleware/RedirectIfInstalled.php
2023-06-11 13:14:03 +01:00

25 lines
461 B
PHP

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