Skip to content

Commit ee92975

Browse files
committed
Ran pint
1 parent dc8bf37 commit ee92975

File tree

72 files changed

+298
-298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+298
-298
lines changed

database/seeders/LaravelCrmPipelineTablesSeeder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class LaravelCrmPipelineTablesSeeder extends Seeder
2222
public function run()
2323
{
2424
// Pipelines stage probabilities
25-
if(! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_pipeline_probabilities')->first()) {
25+
if (! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_pipeline_probabilities')->first()) {
2626
$items = [
2727
[
2828
[
@@ -147,7 +147,7 @@ public function run()
147147
}
148148

149149
// Pipelines
150-
if(! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_pipelines')->first()) {
150+
if (! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_pipelines')->first()) {
151151
$items = [
152152
[
153153
[
@@ -227,7 +227,7 @@ public function run()
227227
}
228228

229229
// Pipelines stages
230-
if(! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_pipelines_stages')->first()) {
230+
if (! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_pipelines_stages')->first()) {
231231
$items = [
232232
// Leads
233233
[

database/seeders/LaravelCrmTablesSeeder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class LaravelCrmTablesSeeder extends Seeder
1919
public function run()
2020
{
2121
// Labels
22-
if(! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_labels')->first()) {
22+
if (! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_labels')->first()) {
2323
$items = [
2424
[
2525
[
@@ -66,7 +66,7 @@ public function run()
6666
}
6767

6868
// Lead statuses (DEPRECATED)
69-
if(! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_lead_statuses')->first()) {
69+
if (! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_lead_statuses')->first()) {
7070
$items = [
7171
[
7272
[
@@ -101,7 +101,7 @@ public function run()
101101
}
102102

103103
// Organisation Types
104-
if(! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_organisation_types')->first()) {
104+
if (! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_organisation_types')->first()) {
105105
$items = [
106106
[
107107
[
@@ -150,7 +150,7 @@ public function run()
150150
}
151151

152152
// Address types
153-
if(! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_address_types')->first()) {
153+
if (! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_address_types')->first()) {
154154
$items = [
155155
[
156156
[
@@ -215,7 +215,7 @@ public function run()
215215
}
216216

217217
// Contact types
218-
if(! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_contact_types')->first()) {
218+
if (! \VentureDrake\LaravelCrm\Models\Setting::where('name', 'db_seeded_contact_types')->first()) {
219219
$items = [
220220
[
221221
[

src/Console/LaravelCrmFields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function handle()
5656
{
5757
$this->info('Updating Laravel CRM custom fields...');
5858

59-
foreach(FieldModel::all() as $fieldModel) {
59+
foreach (FieldModel::all() as $fieldModel) {
6060
$this->line('Updating field: ' . $fieldModel->field->name);
6161

6262
foreach ($fieldModel->model::all() as $model) {

src/Console/LaravelCrmReminders.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function handle()
6464
{
6565
$this->info('Sending Laravel CRM Reminders...');
6666

67-
foreach(Task::whereNull('completed_at')
67+
foreach (Task::whereNull('completed_at')
6868
->where('reminder_email', 0)
6969
->where('due_at', '>=', Carbon::now()->timezone($this->settingService->get('timezone')->value ?? 'UTC')->subMinutes(5)->format('Y-m-d H:i:\\00'))
7070
->where('due_at', '<=', Carbon::now()->timezone($this->settingService->get('timezone')->value ?? 'UTC')->addMinutes(15)->format('Y-m-d H:i:\\00'))
@@ -84,7 +84,7 @@ public function handle()
8484
}
8585
}
8686

87-
foreach(Call::where('reminder_email', 0)
87+
foreach (Call::where('reminder_email', 0)
8888
->where('start_at', '>=', Carbon::now()->timezone($this->settingService->get('timezone')->value ?? 'UTC')->subMinutes(5)->format('Y-m-d H:i:\\00'))
8989
->where('start_at', '<=', Carbon::now()->timezone($this->settingService->get('timezone')->value ?? 'UTC')->addMinutes(15)->format('Y-m-d H:i:\\00'))
9090
->orderBy('start_at', 'asc')
@@ -103,7 +103,7 @@ public function handle()
103103
}
104104
}
105105

106-
foreach(Meeting::where('reminder_email', 0)
106+
foreach (Meeting::where('reminder_email', 0)
107107
->where('start_at', '>=', Carbon::now()->timezone($this->settingService->get('timezone')->value ?? 'UTC')->subMinutes(5)->format('Y-m-d H:i:\\00'))
108108
->where('start_at', '<=', Carbon::now()->timezone($this->settingService->get('timezone')->value ?? 'UTC')->addMinutes(15)->format('Y-m-d H:i:\\00'))
109109
->orderBy('start_at', 'asc')
@@ -122,7 +122,7 @@ public function handle()
122122
}
123123
}
124124

125-
foreach(Lunch::where('reminder_email', 0)
125+
foreach (Lunch::where('reminder_email', 0)
126126
->where('start_at', '>=', Carbon::now()->timezone($this->settingService->get('timezone')->value ?? 'UTC')->subMinutes(5)->format('Y-m-d H:i:\\00'))
127127
->where('start_at', '<=', Carbon::now()->timezone($this->settingService->get('timezone')->value ?? 'UTC')->addMinutes(15)->format('Y-m-d H:i:\\00'))
128128
->orderBy('start_at', 'asc')

src/Console/LaravelCrmUpdate.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function handle()
6666
{
6767
$this->info('Updating Laravel CRM...');
6868

69-
if($this->settingService->get('db_update_0180')->value == 0) {
69+
if ($this->settingService->get('db_update_0180')->value == 0) {
7070
$this->info('Updating Laravel CRM quote numbers...');
7171

7272
foreach (Quote::whereNull('number')->get() as $quote) {
@@ -97,11 +97,11 @@ public function handle()
9797
$this->info('Updating Laravel CRM orders numbers complete');
9898
}
9999

100-
if($this->settingService->get('db_update_0181')->value == 0) {
100+
if ($this->settingService->get('db_update_0181')->value == 0) {
101101
$this->info('Updating Laravel CRM organisation linked to person...');
102102

103103
foreach (Person::whereNotNull('organisation_id')->get() as $person) {
104-
if($contact = $person->contacts()->create([
104+
if ($contact = $person->contacts()->create([
105105
'team_id' => $person->team_id,
106106
'entityable_type' => $person->organisation->getMorphClass(),
107107
'entityable_id' => $person->organisation->id,
@@ -116,13 +116,13 @@ public function handle()
116116
$this->info('Updating Laravel CRM organisation linked to person complete.');
117117
}
118118

119-
if($this->settingService->get('db_update_0191')->value == 0) {
119+
if ($this->settingService->get('db_update_0191')->value == 0) {
120120
$this->info('Updating Laravel CRM split orders, invoices & deliveries...');
121121

122-
foreach(Order::whereNotNull('quote_id')->get() as $order) {
123-
if($order->quote) {
124-
foreach($order->quote->quoteProducts as $quoteProduct) {
125-
if($orderProduct = $order->orderProducts()
122+
foreach (Order::whereNotNull('quote_id')->get() as $order) {
123+
if ($order->quote) {
124+
foreach ($order->quote->quoteProducts as $quoteProduct) {
125+
if ($orderProduct = $order->orderProducts()
126126
->whereNull('quote_product_id')
127127
->where([
128128
'product_id' => $quoteProduct->product_id,
@@ -136,10 +136,10 @@ public function handle()
136136
}
137137
}
138138

139-
foreach(Invoice::whereNotNull('order_id')->get() as $invoice) {
140-
if($invoice->order) {
141-
foreach($invoice->order->orderProducts as $orderProduct) {
142-
if($invoiceLine = $invoice->invoiceLines()
139+
foreach (Invoice::whereNotNull('order_id')->get() as $invoice) {
140+
if ($invoice->order) {
141+
foreach ($invoice->order->orderProducts as $orderProduct) {
142+
if ($invoiceLine = $invoice->invoiceLines()
143143
->whereNull('order_product_id')
144144
->where([
145145
'product_id' => $orderProduct->product_id,
@@ -157,13 +157,13 @@ public function handle()
157157
$this->info('Updating Laravel CRM split orders, invoices & deliveries complete.');
158158
}
159159

160-
if($this->settingService->get('db_update_0193')->value == 0) {
160+
if ($this->settingService->get('db_update_0193')->value == 0) {
161161
$this->info('Updating Laravel CRM split deliveries...');
162162

163-
foreach(Delivery::whereNotNull('order_id')->get() as $delivery) {
164-
if($delivery->order) {
165-
foreach($delivery->order->orderProducts as $orderProduct) {
166-
if($deliveryProduct = $delivery->deliveryProducts()
163+
foreach (Delivery::whereNotNull('order_id')->get() as $delivery) {
164+
if ($delivery->order) {
165+
foreach ($delivery->order->orderProducts as $orderProduct) {
166+
if ($deliveryProduct = $delivery->deliveryProducts()
167167
->whereNull('quantity')
168168
->where([
169169
'order_product_id' => $orderProduct->id,
@@ -180,7 +180,7 @@ public function handle()
180180
$this->info('Updating Laravel CRM split deliveries complete.');
181181
}
182182

183-
if($this->settingService->get('db_update_0194')->value == 0) {
183+
if ($this->settingService->get('db_update_0194')->value == 0) {
184184
$this->info('Updating Laravel CRM delivery numbers...');
185185

186186
foreach (Delivery::whereNull('number')->get() as $delivery) {
@@ -197,15 +197,15 @@ public function handle()
197197
$this->info('Updating Laravel CRM delivery numbers complete');
198198
}
199199

200-
if($this->settingService->get('db_update_0199')->value == 0) {
200+
if ($this->settingService->get('db_update_0199')->value == 0) {
201201
$this->info('Updating Laravel CRM tax amounts...');
202202

203203
foreach (QuoteProduct::whereNull('tax_amount')->get() as $quoteProduct) {
204204
$this->info('Updating Laravel CRM quote product tax #'.$quoteProduct->id);
205205

206-
if($quoteProduct->product && $quoteProduct->product->taxRate) {
206+
if ($quoteProduct->product && $quoteProduct->product->taxRate) {
207207
$taxRate = $quoteProduct->product->taxRate->rate;
208-
} elseif($quoteProduct->product && $quoteProduct->product->tax_rate) {
208+
} elseif ($quoteProduct->product && $quoteProduct->product->tax_rate) {
209209
$taxRate = $quoteProduct->product->tax_rate;
210210
} else {
211211
$taxRate = Setting::where('name', 'tax_rate')->first()->value ?? 0;
@@ -220,9 +220,9 @@ public function handle()
220220
foreach (OrderProduct::whereNull('tax_amount')->get() as $orderProduct) {
221221
$this->info('Updating Laravel CRM order product tax #'.$orderProduct->id);
222222

223-
if($orderProduct->product && $orderProduct->product->taxRate) {
223+
if ($orderProduct->product && $orderProduct->product->taxRate) {
224224
$taxRate = $orderProduct->product->taxRate->rate;
225-
} elseif($orderProduct->product && $orderProduct->product->tax_rate) {
225+
} elseif ($orderProduct->product && $orderProduct->product->tax_rate) {
226226
$taxRate = $orderProduct->product->tax_rate;
227227
} else {
228228
$taxRate = Setting::where('name', 'tax_rate')->first()->value ?? 0;
@@ -237,9 +237,9 @@ public function handle()
237237
foreach (InvoiceLine::whereNull('tax_amount')->get() as $invoiceLine) {
238238
$this->info('Updating Laravel CRM invoice line tax #'.$invoiceLine->id);
239239

240-
if($invoiceLine->product && $invoiceLine->product->taxRate) {
240+
if ($invoiceLine->product && $invoiceLine->product->taxRate) {
241241
$taxRate = $invoiceLine->product->taxRate->rate;
242-
} elseif($invoiceLine->product && $invoiceLine->product->tax_rate) {
242+
} elseif ($invoiceLine->product && $invoiceLine->product->tax_rate) {
243243
$taxRate = $invoiceLine->product->tax_rate;
244244
} else {
245245
$taxRate = Setting::where('name', 'tax_rate')->first()->value ?? 0;
@@ -255,7 +255,7 @@ public function handle()
255255
$this->info('Updating Laravel CRM tax amounts complete');
256256
}
257257

258-
if($this->settingService->get('db_update_1200')->value == 0) {
258+
if ($this->settingService->get('db_update_1200')->value == 0) {
259259
$this->info('Updating Laravel CRM pipeline tables');
260260

261261
$this->callSilent('db:seed', [

src/Http/Controllers/DealController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public function index(Request $request)
5050
{
5151
$viewSetting = auth()->user()->crmSettings()->where('name', 'view_deals')->first();
5252

53-
if(! $viewSetting) {
53+
if (! $viewSetting) {
5454
auth()->user()->crmSettings()->create([
5555
'name' => 'view_deals',
5656
'value' => 'list',
5757
]);
58-
} elseif($viewSetting->value == 'board') {
58+
} elseif ($viewSetting->value == 'board') {
5959
return redirect(route('laravel-crm.deals.board'));
6060
}
6161

@@ -311,7 +311,7 @@ public function search(Request $request)
311311
if (Str::contains($field, '.')) {
312312
$field = explode('.', $field);
313313

314-
if(config('laravel-crm.encrypt_db_fields')) {
314+
if (config('laravel-crm.encrypt_db_fields')) {
315315
try {
316316
$relatedField = decrypt($record->{$field[1]});
317317
} catch (DecryptException $e) {
@@ -334,7 +334,7 @@ public function search(Request $request)
334334
}
335335
});
336336

337-
if($viewSetting->value === 'board') {
337+
if ($viewSetting->value === 'board') {
338338
return view('laravel-crm::deals.board', [
339339
'deals' => $deals,
340340
'searchValue' => $searchValue ?? null,

src/Http/Controllers/DeliveryController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function create(Request $request)
9797

9898
if ($address = $order->getShippingAddress()) {
9999
$addressIds[] = $address->id;
100-
} elseif($address = $order->organisation->getShippingAddress()) {
100+
} elseif ($address = $order->organisation->getShippingAddress()) {
101101
$addressIds[] = $address->id;
102102
}
103103

@@ -242,7 +242,7 @@ public function search(Request $request)
242242
if (Str::contains($field, '.')) {
243243
$field = explode('.', $field);
244244

245-
if(config('laravel-crm.encrypt_db_fields')) {
245+
if (config('laravel-crm.encrypt_db_fields')) {
246246
try {
247247
$relatedField = decrypt($record->{$field[1]});
248248
} catch (DecryptException $e) {

src/Http/Controllers/InvoiceController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function search(Request $request)
256256
if (Str::contains($field, '.')) {
257257
$field = explode('.', $field);
258258

259-
if(config('laravel-crm.encrypt_db_fields')) {
259+
if (config('laravel-crm.encrypt_db_fields')) {
260260
try {
261261
$relatedField = decrypt($record->{$field[1]});
262262
} catch (DecryptException $e) {

src/Http/Controllers/LeadController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ public function index(Request $request)
5858
{
5959
$viewSetting = auth()->user()->crmSettings()->where('name', 'view_leads')->first();
6060

61-
if(! $viewSetting) {
61+
if (! $viewSetting) {
6262
auth()->user()->crmSettings()->create([
6363
'name' => 'view_leads',
6464
'value' => 'list',
6565
]);
66-
} elseif($viewSetting->value == 'board') {
66+
} elseif ($viewSetting->value == 'board') {
6767
return redirect(route('laravel-crm.leads.board'));
6868
}
6969

@@ -307,7 +307,7 @@ public function search(Request $request)
307307
if (Str::contains($field, '.')) {
308308
$field = explode('.', $field);
309309

310-
if(config('laravel-crm.encrypt_db_fields')) {
310+
if (config('laravel-crm.encrypt_db_fields')) {
311311
try {
312312
$relatedField = decrypt($record->{$field[1]});
313313
} catch (DecryptException $e) {
@@ -331,7 +331,7 @@ public function search(Request $request)
331331
}
332332
});
333333

334-
if($viewSetting->value === 'board') {
334+
if ($viewSetting->value === 'board') {
335335
return view('laravel-crm::leads.board', [
336336
'leads' => $leads,
337337
'searchValue' => $searchValue ?? null,

src/Http/Controllers/OrderController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public function search(Request $request)
346346
if (Str::contains($field, '.')) {
347347
$field = explode('.', $field);
348348

349-
if(config('laravel-crm.encrypt_db_fields')) {
349+
if (config('laravel-crm.encrypt_db_fields')) {
350350
try {
351351
$relatedField = decrypt($record->{$field[1]});
352352
} catch (DecryptException $e) {

src/Http/Controllers/OrganisationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function update(UpdateOrganisationRequest $request, Organisation $organis
150150
*/
151151
public function destroy(Organisation $organisation)
152152
{
153-
foreach(Contact::where([
153+
foreach (Contact::where([
154154
'entityable_type' => $organisation->getMorphClass(),
155155
'entityable_id' => $organisation->id
156156
])->get() as $contact) {

src/Http/Controllers/PersonController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function update(UpdatePersonRequest $request, Person $person)
201201
*/
202202
public function destroy(Person $person)
203203
{
204-
foreach(Contact::where([
204+
foreach (Contact::where([
205205
'entityable_type' => $person->getMorphClass(),
206206
'entityable_id' => $person->id
207207
])->get() as $contact) {

0 commit comments

Comments
 (0)