@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $recordsSince = TenantPerson::orderBy('updated_at', 'desc')->first()?->updated_at; |
34 | 34 | $this->info('Tenant people records syncronization since: '.($recordsSince ?: 'start')); |
35 | 35 | |
36 | - tenancy()->query()->cursor()->each(function (Tenant $tenant) use ($recordsSince) { |
|
36 | + tenancy()->query()->cursor()->each(function(Tenant $tenant) use ($recordsSince) { |
|
37 | 37 | try { |
38 | 38 | tenancy()->initialize($tenant); |
39 | 39 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | $this->info('Processing tenant #'.$tenant->id.' records: '.(clone $tenantPersonQuery)->count()); |
47 | - $tenantPersonQuery->chunk(100, function ($people) use ($tenant) { |
|
47 | + $tenantPersonQuery->chunk(100, function($people) use ($tenant) { |
|
48 | 48 | // clear old records and push updated ones |
49 | 49 | TenantPerson::where('tenant_id', $tenant->id) |
50 | 50 | ->whereIn('tenant_person_id', $people->pluck('id')) |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $user = User::where('stripe_id', $data['data']['object']['customer'])->first(); |
37 | 37 | if ($user) { |
38 | 38 | $plan_nickname = $data['data']['object']['plan']['nickname']; |
39 | - $roles= Role::where('name', strtolower($plan_nickname))->first(); |
|
39 | + $roles = Role::where('name', strtolower($plan_nickname))->first(); |
|
40 | 40 | if ($roles) { |
41 | 41 | $user->role_id = $roles->id; |
42 | 42 | $user->save(); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $user = User::where('stripe_id', $data['data']['object']['customer'])->first(); |
49 | 49 | if ($user) { |
50 | 50 | $plan_nickname = $data['data']['object']['lines']['data'][0]['plan']['nickname']; |
51 | - $roles= Role::where('name', strtolower($plan_nickname))->first(); |
|
51 | + $roles = Role::where('name', strtolower($plan_nickname))->first(); |
|
52 | 52 | if ($roles) { |
53 | 53 | $user->role_id = $roles->id; |
54 | 54 | $user->save(); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | case "invoice.payment_failed" : |
59 | 59 | $user = User::where('stripe_id', $data['data']['object']['customer'])->first(); |
60 | 60 | if ($user) { |
61 | - $roles= Role::where('name', strtolower("free"))->first(); |
|
61 | + $roles = Role::where('name', strtolower("free"))->first(); |
|
62 | 62 | if ($roles) { |
63 | 63 | $user->role_id = $roles->id; |
64 | 64 | $user->save(); |