@@ -65,7 +65,7 @@ |
||
65 | 65 | throw new \Exception('inconsistency detected'); |
66 | 66 | } |
67 | 67 | |
68 | - DB::transaction(function () use ($tenantUser, $user) { |
|
68 | + DB::transaction(function() use ($tenantUser, $user) { |
|
69 | 69 | |
70 | 70 | $user->grantedRecruitments()->detach(); |
71 | 71 | $tenantUser->delete(); |
@@ -40,11 +40,11 @@ |
||
40 | 40 | { |
41 | 41 | $user = Auth::user(); |
42 | 42 | if ($user->can('read all recruitments')) { |
43 | - $recruitments = Recruitment::where('is_draft', false)->with('sources')->withCount(['candidates as new_candidates_count' => function ($query) { |
|
43 | + $recruitments = Recruitment::where('is_draft', false)->with('sources')->withCount(['candidates as new_candidates_count' => function($query) { |
|
44 | 44 | $query->whereNull('seen_at'); |
45 | 45 | }])->orderByDesc('created_at')->get(); |
46 | 46 | } else { |
47 | - $recruitments = $user->grantedRecruitments()->where('is_draft', false)->with('sources')->withCount(['candidates as new_candidates_count' => function ($query) { |
|
47 | + $recruitments = $user->grantedRecruitments()->where('is_draft', false)->with('sources')->withCount(['candidates as new_candidates_count' => function($query) { |
|
48 | 48 | $query->whereNull('seen_at'); |
49 | 49 | }])->orderByDesc('created_at')->get(); |
50 | 50 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | protected function registerDatabaseConnector($manager) |
14 | 14 | { |
15 | - $manager->addConnector('database', function () { |
|
15 | + $manager->addConnector('database', function() { |
|
16 | 16 | return new DatabaseConnector($this->app['db']); |
17 | 17 | }); |
18 | 18 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | protected function commands() |
37 | 37 | { |
38 | - $this->load(__DIR__.'/Commands'); |
|
38 | + $this->load(__DIR__ . '/Commands'); |
|
39 | 39 | |
40 | 40 | require base_path('routes/console.php'); |
41 | 41 | } |
@@ -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); |
@@ -70,6 +70,6 @@ discard block |
||
70 | 70 | $seeder->setConnection('tenant'); |
71 | 71 | $seeder->run(); |
72 | 72 | |
73 | - $this->info('Demo data have been seeded for tenant with subdomain \''.$tenant->subdomain.'\'.'); |
|
73 | + $this->info('Demo data have been seeded for tenant with subdomain \'' . $tenant->subdomain . '\'.'); |
|
74 | 74 | } |
75 | 75 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $tenantUser->username = $user->email; |
35 | 35 | $tenantUser->tenant_id = $tenant->id; |
36 | 36 | |
37 | - DB::transaction(function () use ($tenantUser, $user, $invitation) { |
|
37 | + DB::transaction(function() use ($tenantUser, $user, $invitation) { |
|
38 | 38 | $tenantUser->save(); |
39 | 39 | $user->save(); |
40 | 40 | $invitation->save(); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | $invitation->token = null; |
72 | 72 | |
73 | - DB::transaction(function () use ($user, $invitation) { |
|
73 | + DB::transaction(function() use ($user, $invitation) { |
|
74 | 74 | $user->save(); |
75 | 75 | $invitation->save(); |
76 | 76 | }); |
@@ -17,15 +17,15 @@ |
||
17 | 17 | $manager = new TenantManager(); |
18 | 18 | |
19 | 19 | $this->app->instance(TenantManager::class, $manager); |
20 | - $this->app->bind(Tenant::class, function () use ($manager) { |
|
20 | + $this->app->bind(Tenant::class, function() use ($manager) { |
|
21 | 21 | return $manager->getTenant(); |
22 | 22 | }); |
23 | 23 | |
24 | - $this->app['db']->extend('tenant', function ($config, $name) use ($manager) { |
|
24 | + $this->app['db']->extend('tenant', function($config, $name) use ($manager) { |
|
25 | 25 | $tenant = $manager->getTenant(); |
26 | 26 | |
27 | 27 | if ($tenant) { |
28 | - $config['database'] = 'tenant_'.$tenant->id; |
|
28 | + $config['database'] = 'tenant_' . $tenant->id; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | return $this->app['db.factory']->make($config, $name); |
@@ -50,6 +50,6 @@ |
||
50 | 50 | |
51 | 51 | protected function getCvPath() |
52 | 52 | { |
53 | - return storage_path('app/'.$this->candidate->path_to_cv); |
|
53 | + return storage_path('app/' . $this->candidate->path_to_cv); |
|
54 | 54 | } |
55 | 55 | } |
@@ -27,16 +27,16 @@ |
||
27 | 27 | |
28 | 28 | public function handle() |
29 | 29 | { |
30 | - $database = 'tenant_'.$this->tenant->id; |
|
30 | + $database = 'tenant_' . $this->tenant->id; |
|
31 | 31 | $connection = \DB::connection('tenant'); |
32 | - $createMysql = $connection->statement('CREATE DATABASE '.$database); |
|
32 | + $createMysql = $connection->statement('CREATE DATABASE ' . $database); |
|
33 | 33 | |
34 | 34 | if ($createMysql) { |
35 | 35 | $this->tenantManager->setTenant($this->tenant); |
36 | 36 | \DB::connection('tenant')->purge(); |
37 | 37 | $this->migrate(); |
38 | 38 | } else { |
39 | - $connection->statement('DROP DATABASE '.$database); |
|
39 | + $connection->statement('DROP DATABASE ' . $database); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 |