Uses database config from env while install

This commit is contained in:
Yasir Turk 2022-08-08 19:06:23 +02:00
parent 3e76375f26
commit c2549b96ad
2 changed files with 10 additions and 8 deletions

View File

@ -15,7 +15,9 @@ class Database extends Controller
*/
public function create()
{
return view('install.database.create');
$connection = config('database.default','mysql');
return view('install.database.create')->with(config("database.connections.$connection"));
}
/**

View File

@ -5,13 +5,13 @@
<x-slot name="content">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.text name="hostname" label="{{ trans('install.database.hostname') }}" value="{{ old('hostname', 'localhost') }}" form-group-class="sm:col-span-6" />
<x-form.group.text name="username" label="{{ trans('install.database.username') }}" value="{{ old('username') }}" form-group-class="sm:col-span-6" />
<x-form.group.password name="password" label="{{ trans('install.database.password') }}" not-required form-group-class="sm:col-span-6" />
<x-form.group.text name="database" label="{{ trans('install.database.name') }}" value="{{ old('database') }}" form-group-class="sm:col-span-6" />
<x-form.group.text name="hostname" label="{{ trans('install.database.hostname') }}" value="{{ old('hostname', $host ?? 'localhost') }}" form-group-class="sm:col-span-6" />
<x-form.group.text name="username" label="{{ trans('install.database.username') }}" value="{{ old('username', $username) }}" form-group-class="sm:col-span-6" />
<x-form.group.password name="password" label="{{ trans('install.database.password') }}" value="{{ $password }}" not-required form-group-class="sm:col-span-6" />
<x-form.group.text name="database" label="{{ trans('install.database.name') }}" value="{{ old('database', $database) }}" form-group-class="sm:col-span-6" />
</div>
</x-slot>
</x-layouts.install>