Skip to content

Commit

Permalink
chore: fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmanramsi authored and github-actions[bot] committed Nov 20, 2023
1 parent 2085e0d commit be2c3a7
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions app/Livewire/Forms/InstallationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

namespace App\Livewire\Forms;

use Livewire\Form;
use App\Models\User;
use App\Actions\Conferences\ConferenceCreateAction;
use App\Actions\User\UserCreateAction;
use App\Models\Conference;
use Livewire\Attributes\Rule;
use App\Models\Enums\UserRole;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use App\Actions\User\UserCreateAction;
use Illuminate\Auth\Events\Registered;
use App\Models\User;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Artisan;
use App\Actions\Conferences\ConferenceCreateAction;
use Livewire\Attributes\Rule;
use Livewire\Form;

class InstallationForm extends Form
{
Expand Down Expand Up @@ -125,7 +123,7 @@ public function checkDatabaseConnection(): bool

session()->flash('success', 'Successfully Connected');
} catch (\Throwable $th) {
$this->addError('databaseOperationError', 'Connection failed: ' . $th->getMessage());
$this->addError('databaseOperationError', 'Connection failed: '.$th->getMessage());

return false;
}
Expand All @@ -141,7 +139,7 @@ public function createDatabase(): bool

$databaseExists = $this->checkDatabaseExists($dbName);

if (!$databaseExists) {
if (! $databaseExists) {
$this->createNewDatabase($dbName);
}

Expand All @@ -153,7 +151,7 @@ public function createDatabase(): bool

session()->flash('success', 'Connection success and database successfully created');
} catch (\Throwable $th) {
$this->addError('databaseOperationError', 'Create database failed: Please manually create your database ' . $th->getMessage());
$this->addError('databaseOperationError', 'Create database failed: Please manually create your database '.$th->getMessage());

return false;
}
Expand All @@ -170,7 +168,7 @@ private function prepareDatabaseConnection(): array
'database' => '',
]);

if (!empty($this->db_username) && !empty($this->db_password)) {
if (! empty($this->db_username) && ! empty($this->db_password)) {
$connectionArray = array_merge($connectionArray, [
'username' => $this->db_username,
'password' => $this->db_password,
Expand All @@ -184,7 +182,7 @@ private function prepareDatabaseConnection(): array

private function checkDatabaseExists($dbName): bool
{
return !empty(DB::select("SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '$dbName'"));
return ! empty(DB::select("SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '$dbName'"));
}

private function createNewDatabase($dbName): void
Expand Down

0 comments on commit be2c3a7

Please sign in to comment.