mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 00:22:15 +00:00
setup wizard update
This commit is contained in:
@@ -2,10 +2,13 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Setting;
|
||||
use Doctrine\DBAL\Driver\PDOException;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request;
|
||||
use Response;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
|
||||
class AppFunctionsController extends Controller
|
||||
{
|
||||
@@ -16,6 +19,31 @@ class AppFunctionsController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view("index");
|
||||
try {
|
||||
$connection = $this->get_setup_status();
|
||||
$settings = json_decode(Setting::all()->pluck('value', 'name')->toJson());
|
||||
|
||||
} catch (PDOException $e) {
|
||||
$connection = 'setup-database';
|
||||
$settings = null;
|
||||
}
|
||||
|
||||
return view("index")
|
||||
->with('settings', $settings)
|
||||
->with('installation', $connection);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private function get_setup_status(): string
|
||||
{
|
||||
\DB::getPdo();
|
||||
|
||||
$setup_success = Setting::where('name', 'setup_wizard_success')->first();
|
||||
|
||||
$connection = $setup_success ? 'setup-done' : 'setup-disclaimer';
|
||||
|
||||
return $connection;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user