setup wizard update

This commit is contained in:
carodej
2020-07-02 12:31:14 +02:00
parent a98625876d
commit 2764fd6dd5
18 changed files with 521 additions and 327 deletions

View File

@@ -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;
}
}