@@ -49,21 +49,21 @@ |
||
| 49 | 49 | $num = Tenant::where('subdomain', $subdomain)->count(); |
| 50 | 50 | |
| 51 | 51 | if ($num) { |
| 52 | - throw new RuntimeException('Tenant with subdomain \''.$subdomain.'\' already exists.'); |
|
| 52 | + throw new RuntimeException('Tenant with subdomain \'' . $subdomain . '\' already exists.'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | $tenant = new Tenant(); |
| 56 | 56 | $tenant->subdomain = $subdomain; |
| 57 | 57 | $tenant->save(); |
| 58 | 58 | |
| 59 | - $databaseName = 'tenant_'.$tenant->id; |
|
| 60 | - DB::connection('tenant')->statement('CREATE DATABASE '.$databaseName); |
|
| 59 | + $databaseName = 'tenant_' . $tenant->id; |
|
| 60 | + DB::connection('tenant')->statement('CREATE DATABASE ' . $databaseName); |
|
| 61 | 61 | |
| 62 | 62 | $this->callSilent('tenant:migrate', [ |
| 63 | 63 | 'tenantId' => $tenant->id, |
| 64 | 64 | ]); |
| 65 | 65 | |
| 66 | - $this->info('Created tenant with subdomain \''.$subdomain.'\' and ID '.$tenant->id.'.'); |
|
| 66 | + $this->info('Created tenant with subdomain \'' . $subdomain . '\' and ID ' . $tenant->id . '.'); |
|
| 67 | 67 | $this->info('Database tables has been migrated.'); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -50,14 +50,14 @@ discard block |
||
| 50 | 50 | $tenant = Tenant::find($tenantId); |
| 51 | 51 | |
| 52 | 52 | if (!$tenant) { |
| 53 | - throw new RuntimeException('Tenant with ID = '.$tenantId.' does not exist.'); |
|
| 53 | + throw new RuntimeException('Tenant with ID = ' . $tenantId . ' does not exist.'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | if (!$this->confirm('Do you REALLY WANT to run import legacy data?')) { |
| 57 | 57 | return; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if (!$this->confirm('It will ERASE ALL current data for ::'.$tenant->subdomain.':: tenant. Are you sure?')) { |
|
| 60 | + if (!$this->confirm('It will ERASE ALL current data for ::' . $tenant->subdomain . ':: tenant. Are you sure?')) { |
|
| 61 | 61 | return; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | DB::connection('tenant')->delete('DELETE FROM user_invitations'); |
| 77 | 77 | DB::connection('tenant')->delete('DELETE FROM users'); |
| 78 | 78 | |
| 79 | - DB::connection()->delete('DELETE FROM tenant_users WHERE tenant_id='.$tenant->id); |
|
| 79 | + DB::connection()->delete('DELETE FROM tenant_users WHERE tenant_id=' . $tenant->id); |
|
| 80 | 80 | |
| 81 | 81 | DB::connection('tenant')->statement('ALTER TABLE sources AUTO_INCREMENT = 1;'); |
| 82 | 82 | DB::connection('tenant')->statement('ALTER TABLE notes AUTO_INCREMENT = 1;'); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $stageId++; |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | - $fields = json_decode(file_get_contents(base_path().'/database/seeds/form_fields.json'), true); |
|
| 207 | + $fields = json_decode(file_get_contents(base_path() . '/database/seeds/form_fields.json'), true); |
|
| 208 | 208 | $now = \Carbon\Carbon::now()->toDateTimeString(); |
| 209 | 209 | |
| 210 | 210 | foreach ($fields as $field) { |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | ]); |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | - $messages = json_decode(file_get_contents(base_path().'/database/seeds/predefined_messages.json'), true); |
|
| 224 | + $messages = json_decode(file_get_contents(base_path() . '/database/seeds/predefined_messages.json'), true); |
|
| 225 | 225 | |
| 226 | 226 | foreach ($messages as $message) { |
| 227 | 227 | $from_stage_id = null; |
@@ -270,10 +270,10 @@ discard block |
||
| 270 | 270 | |
| 271 | 271 | $candidates = DB::connection('legacy')->select('SELECT * FROM candidates'); |
| 272 | 272 | foreach ($candidates as $candidate) { |
| 273 | - $customFields = '[{"id": 0, "label": "Informacje dodatkowe", "value": '.json_encode($candidate->additional_info).'}]'; |
|
| 273 | + $customFields = '[{"id": 0, "label": "Informacje dodatkowe", "value": ' . json_encode($candidate->additional_info) . '}]'; |
|
| 274 | 274 | $seenAt = $candidate->stage_id != 1 ? $candidate->created_at : null; |
| 275 | 275 | |
| 276 | - $pathToCV = 'kissdigital/'.$candidate->path_to_cv; |
|
| 276 | + $pathToCV = 'kissdigital/' . $candidate->path_to_cv; |
|
| 277 | 277 | |
| 278 | 278 | $stageId = 0; |
| 279 | 279 | |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | $candidate->id, |
| 324 | 324 | $candidate->created_at, |
| 325 | 325 | $candidate->updated_at, |
| 326 | - $candidate->first_name.' '.$candidate->last_name, |
|
| 326 | + $candidate->first_name . ' ' . $candidate->last_name, |
|
| 327 | 327 | $candidate->email, |
| 328 | 328 | $candidate->phone_number, |
| 329 | 329 | $candidate->future_agreement, |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | |
| 374 | 374 | $messages = DB::connection('legacy')->select('SELECT * FROM messages'); |
| 375 | 375 | foreach ($messages as $message) { |
| 376 | - $candidate = DB::connection('tenant')->select('SELECT * FROM candidates WHERE `id`='.$message->candidate_id); |
|
| 376 | + $candidate = DB::connection('tenant')->select('SELECT * FROM candidates WHERE `id`=' . $message->candidate_id); |
|
| 377 | 377 | DB::connection('tenant')->insert( |
| 378 | 378 | 'INSERT INTO messages (id, created_at, updated_at, `type`, candidate_id, |
| 379 | 379 | `subject`, `body`, `scheduled_for`, `sent_at`, `to`) |
@@ -393,6 +393,6 @@ discard block |
||
| 393 | 393 | ); |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | - $this->info('Legacy data have been imported for tenant with subdomain \''.$tenant->subdomain.'\'.'); |
|
| 396 | + $this->info('Legacy data have been imported for tenant with subdomain \'' . $tenant->subdomain . '\'.'); |
|
| 397 | 397 | } |
| 398 | 398 | } |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | $tenant = Tenant::find($tenantId); |
| 54 | 54 | |
| 55 | 55 | if (!$tenant) { |
| 56 | - throw new RuntimeException('Tenant with ID = '.$tenantId.' does not exist.'); |
|
| 56 | + throw new RuntimeException('Tenant with ID = ' . $tenantId . ' does not exist.'); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $this->comment('Creating new user for tenant with subdomain \''.$tenant->subdomain.'\'.'); |
|
| 59 | + $this->comment('Creating new user for tenant with subdomain \'' . $tenant->subdomain . '\'.'); |
|
| 60 | 60 | |
| 61 | 61 | $email = $this->option('email'); |
| 62 | 62 | if (!$email) { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $num = TenantUser::where('username', $email)->count(); |
| 67 | 67 | if ($num) { |
| 68 | - throw new RuntimeException('User with email \''.$email.'\' already exists.'); |
|
| 68 | + throw new RuntimeException('User with email \'' . $email . '\' already exists.'); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $name = $this->option('name'); |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $user->assignRole('super-admin'); |
| 92 | 92 | |
| 93 | - DB::transaction(function () use ($tenantUser, $user) { |
|
| 93 | + DB::transaction(function() use ($tenantUser, $user) { |
|
| 94 | 94 | $tenantUser->save(); |
| 95 | 95 | $user->save(); |
| 96 | 96 | }); |
| 97 | 97 | |
| 98 | - $this->comment('Created user with username \''.$user->email.'\'.'); |
|
| 98 | + $this->comment('Created user with username \'' . $user->email . '\'.'); |
|
| 99 | 99 | } |
| 100 | 100 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $tenant = Tenant::find($tenantId); |
| 51 | 51 | |
| 52 | 52 | if (!$tenant) { |
| 53 | - throw new RuntimeException('Tenant with ID = '.$tenantId.' does not exist.'); |
|
| 53 | + throw new RuntimeException('Tenant with ID = ' . $tenantId . ' does not exist.'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $this->tenantManager->setTenant($tenant); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $candidates = Candidate::whereNull('photo_extraction')->where('path_to_cv', '<>', '')->get(); |
| 60 | 60 | |
| 61 | 61 | foreach ($candidates as $candidate) { |
| 62 | - $this->info('Parsing candidate id '.$candidate->id); |
|
| 62 | + $this->info('Parsing candidate id ' . $candidate->id); |
|
| 63 | 63 | ProcessResume::dispatchNow($candidate); |
| 64 | 64 | gc_collect_cycles(); |
| 65 | 65 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $tenant = Tenant::find($tenantId); |
| 49 | 49 | |
| 50 | 50 | if (!$tenant) { |
| 51 | - throw new RuntimeException('Tenant with ID = '.$tenantId.' does not exist.'); |
|
| 51 | + throw new RuntimeException('Tenant with ID = ' . $tenantId . ' does not exist.'); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | $this->tenantManager->setTenant($tenant); |
@@ -57,6 +57,6 @@ discard block |
||
| 57 | 57 | $seeder = new \RolesAndPermissionsSeeder('tenant'); |
| 58 | 58 | $seeder->run(null); |
| 59 | 59 | |
| 60 | - $this->info('Data have been seeded for tenant with subdomain \''.$tenant->subdomain.'\'.'); |
|
| 60 | + $this->info('Data have been seeded for tenant with subdomain \'' . $tenant->subdomain . '\'.'); |
|
| 61 | 61 | } |
| 62 | 62 | } |