mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 21:44:51 +00:00
Improve installed database detection
This commit is contained in:
@@ -4,6 +4,7 @@ namespace InvoiceShelf\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use InvoiceShelf\Space\InstallUtils;
|
||||
|
||||
class InstallationMiddleware
|
||||
{
|
||||
@@ -15,14 +16,12 @@ class InstallationMiddleware
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if (! \Storage::disk('local')->has('database_created')) {
|
||||
return redirect('/installation');
|
||||
}
|
||||
|
||||
if (\Storage::disk('local')->has('database_created')) {
|
||||
if (Setting::getSetting('profile_complete') !== 'COMPLETED') {
|
||||
return redirect('/installation');
|
||||
if (! InstallUtils::isDbCreated() || Setting::getSetting('profile_complete') !== 'COMPLETED') {
|
||||
if (InstallUtils::dbMarkerExists()) {
|
||||
InstallUtils::deleteDbMarker();
|
||||
}
|
||||
|
||||
return redirect('/installation');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
||||
Reference in New Issue
Block a user