mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-25 10:20:38 +00:00
Setup Wizard middleware implemented
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Support\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Doctrine\DBAL\Driver\PDOException;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Schema;
|
||||
|
||||
class ProtectSetupWizardRoutes
|
||||
{
|
||||
/**
|
||||
* Prevent access for setup wizard controllers after initial app installation.
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): mixed
|
||||
{
|
||||
try {
|
||||
// Check database connections
|
||||
DB::getPdo();
|
||||
|
||||
// Get setup_wizard status
|
||||
if (Schema::hasTable('settings') && get_setting('setup_wizard_success')) {
|
||||
return response('Gone', 410);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
||||
} catch (PDOException $e) {
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user