Files
InvoiceShelf/app/Http/Middleware/RedirectIfInstalled.php
2024-02-04 19:37:09 +01:00

28 lines
575 B
PHP

<?php
namespace InvoiceShelf\Http\Middleware;
use Closure;
use InvoiceShelf\Models\Setting;
use InvoiceShelf\Space\InstallUtils;
class RedirectIfInstalled
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public function handle($request, Closure $next)
{
if (InstallUtils::dbMarkerExists()) {
if (Setting::getSetting('profile_complete') === 'COMPLETED') {
return redirect('login');
}
}
return $next($request);
}
}