mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-08 05:54:47 +00:00
30 lines
664 B
PHP
30 lines
664 B
PHP
<?php
|
|
|
|
namespace InvoiceShelf\Http\Middleware;
|
|
|
|
use Closure;
|
|
use InvoiceShelf\Models\Setting;
|
|
use InvoiceShelf\Space\InstallUtils;
|
|
|
|
class InstallationMiddleware
|
|
{
|
|
/**
|
|
* Handle an incoming request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next)
|
|
{
|
|
if (! InstallUtils::isDbCreated() || Setting::getSetting('profile_complete') !== 'COMPLETED') {
|
|
if (InstallUtils::dbMarkerExists()) {
|
|
InstallUtils::deleteDbMarker();
|
|
}
|
|
|
|
return redirect('/installation');
|
|
}
|
|
|
|
return $next($request);
|
|
}
|
|
}
|