@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | $paypalProduct = PaypalProduct::where($product)->first(); |
30 | 30 | |
31 | - if (! $paypalProduct) { |
|
31 | + if (!$paypalProduct) { |
|
32 | 32 | $pp = new PaypalSubscription(); |
33 | 33 | $response = $pp->createProduct($product); |
34 | 34 | $product['paypal_id'] = $response['id']; |
@@ -247,7 +247,7 @@ |
||
247 | 247 | foreach ($plans as $plan) { |
248 | 248 | $paypalPlan = PaypalPlan::where('name', $plan['name'])->first(); |
249 | 249 | |
250 | - if (! $paypalPlan) { |
|
250 | + if (!$paypalPlan) { |
|
251 | 251 | $response = $pp->createPlan($plan, $product); |
252 | 252 | |
253 | 253 | PaypalPlan::create([ |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $manager = Manager::fromModel($request->user()->company(), $request->user()); |
24 | 24 | ExportGedCom::dispatch($filePath, $request->user()); |
25 | 25 | |
26 | - $filePath = $manager->storage()->path($filePath); |
|
26 | + $filePath = $manager->storage()->path($filePath); |
|
27 | 27 | Log::info("Read gedfile from ". $manager->storage()->path($filePath)); |
28 | 28 | // var_dump($filePath); |
29 | 29 | return json_encode([ |
@@ -19,12 +19,12 @@ |
||
19 | 19 | $file = env('APP_NAME').date('_Ymd_').$ts.'.ged'; |
20 | 20 | $file = str_replace(' ', '', $file); |
21 | 21 | $file = str_replace("'", '', $file); |
22 | - $filePath = 'public/' . $file; |
|
22 | + $filePath = 'public/'.$file; |
|
23 | 23 | $manager = Manager::fromModel($request->user()->company(), $request->user()); |
24 | 24 | ExportGedCom::dispatch($filePath, $request->user()); |
25 | 25 | |
26 | 26 | $filePath = $manager->storage()->path($filePath); |
27 | - Log::info("Read gedfile from ". $manager->storage()->path($filePath)); |
|
27 | + Log::info("Read gedfile from ".$manager->storage()->path($filePath)); |
|
28 | 28 | // var_dump($filePath); |
29 | 29 | return json_encode([ |
30 | 30 | // 'file' => $manager->storage()->path($filePath) , |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $paymentMethod = $request->payment_method; |
30 | 30 | |
31 | 31 | $subscription = $user->newSubscription('default', $plan_id) |
32 | - ->trialDays(14); |
|
32 | + ->trialDays(14); |
|
33 | 33 | |
34 | 34 | if ($couponId = $request->input('coupon_id')) { |
35 | 35 | $subscription->withCoupon($couponId); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | try { |
22 | 22 | $user->createAsStripeCustomer(); |
23 | - } catch(\Exception) { |
|
23 | + } catch (\Exception) { |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | $plan_id = $request->input('plan_id'); |
@@ -35,11 +35,11 @@ |
||
35 | 35 | try { |
36 | 36 | $coupon = $stripeSub->discount->coupon; |
37 | 37 | // check the type of coupon - it can be 'fixed_amount' or 'percent_off' |
38 | - if($coupon->amount_off) { |
|
38 | + if ($coupon->amount_off) { |
|
39 | 39 | $discountAmount = $coupon->amount_off; |
40 | 40 | $finalPrice = $price - $discountAmount; |
41 | - } else if($coupon->percent_off) { |
|
42 | - $discountAmount = ($price * $coupon->percent_off/100); |
|
41 | + } else if ($coupon->percent_off) { |
|
42 | + $discountAmount = ($price * $coupon->percent_off / 100); |
|
43 | 43 | $finalPrice = $price - $discountAmount; |
44 | 44 | } |
45 | 45 | } catch (\Exception $e) { |
@@ -19,7 +19,7 @@ |
||
19 | 19 | $user = auth()->user(); |
20 | 20 | |
21 | 21 | try { |
22 | - $user->createAsStripeCustomer(); |
|
22 | + $user->createAsStripeCustomer(); |
|
23 | 23 | } catch(\Exception $e) { |
24 | 24 | } |
25 | 25 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | try { |
22 | 22 | $user->createAsStripeCustomer(); |
23 | - } catch(\Exception $e) { |
|
23 | + } catch (\Exception $e) { |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | $couponCode = $request->input('coupon_code'); |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | } |
347 | 347 | if(! $user->isAdmin()){ |
348 | 348 | |
349 | - $tenants = Tenant::find($main_company->id); |
|
349 | + $tenants = Tenant::find($main_company->id); |
|
350 | 350 | } |
351 | 351 | if ($user->isAdmin()) { |
352 | 352 | $tenants = null; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | if ($main_company === null && ! $user->isAdmin()) { |
355 | 355 | // if (($main_company == null||$tenants=='') && ! $user->isAdmin()) { |
356 | 356 | // if ($main_company == null) { |
357 | - $this->create_company($user); |
|
357 | + $this->create_company($user); |
|
358 | 358 | } else { |
359 | 359 | if ($tenants && ! $user->isAdmin()) { |
360 | 360 | // $c = DB::connection('tenantdb',$tenants->tenancy_db_name)->table('users')->count(); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function redirectToProvider($provider) |
51 | 51 | { |
52 | 52 | $validated = $this->validateProvider($provider); |
53 | - if (! is_null($validated)) { |
|
53 | + if (!is_null($validated)) { |
|
54 | 54 | return $validated; |
55 | 55 | } |
56 | 56 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $curUser = User::where('email', $user->getEmail())->first(); |
75 | 75 | |
76 | - if (! $curUser) { |
|
76 | + if (!$curUser) { |
|
77 | 77 | try { |
78 | 78 | // create person |
79 | 79 | $person = new Person(); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | public function needsToCreateSocial(User $user, $service) |
148 | 148 | { |
149 | - return ! $user->hasSocialLinked($service); |
|
149 | + return !$user->hasSocialLinked($service); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | public function unique_random($table, $col, $chars = 16) |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | // If unique is still false at this point |
183 | 183 | // it will just repeat all the steps until |
184 | 184 | // it has generated a random string of characters |
185 | - } while (! $unique); |
|
185 | + } while (!$unique); |
|
186 | 186 | |
187 | 187 | return $random; |
188 | 188 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | { |
207 | 207 | $this->user = $this->loggableUser($request); |
208 | 208 | |
209 | - if (! $this->user) { |
|
209 | + if (!$this->user) { |
|
210 | 210 | return false; |
211 | 211 | } |
212 | 212 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | 'password' => 'required|string', |
257 | 257 | ]; |
258 | 258 | |
259 | - if (! $request->attributes->get('sanctum')) { |
|
259 | + if (!$request->attributes->get('sanctum')) { |
|
260 | 260 | $attributes['device_name'] = 'required|string'; |
261 | 261 | } |
262 | 262 | |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | */ |
270 | 270 | protected function validateProvider($provider) |
271 | 271 | { |
272 | - if (! in_array($provider, ['facebook', 'google', 'github'])) { |
|
272 | + if (!in_array($provider, ['facebook', 'google', 'github'])) { |
|
273 | 273 | return response()->json(['error' => 'Please login using facebook or google or github'], 422); |
274 | 274 | } |
275 | 275 | } |
@@ -311,11 +311,11 @@ discard block |
||
311 | 311 | { |
312 | 312 | $user = User::whereEmail($request->input('email'))->first(); |
313 | 313 | |
314 | - if (! optional($user)->currentPasswordIs($request->input('password'))) { |
|
314 | + if (!optional($user)->currentPasswordIs($request->input('password'))) { |
|
315 | 315 | return; |
316 | 316 | } |
317 | 317 | |
318 | - if (! $user->email) { |
|
318 | + if (!$user->email) { |
|
319 | 319 | throw ValidationException::withMessages([ |
320 | 320 | 'email' => 'Email does not exist.', |
321 | 321 | ]); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | ]); |
333 | 333 | } |
334 | 334 | |
335 | - if (! App::runningUnitTests()) { |
|
335 | + if (!App::runningUnitTests()) { |
|
336 | 336 | $company = $user->person->company(); |
337 | 337 | // \Log::debug('Login----------------------'.$company); |
338 | 338 | $tenant = false; |
@@ -341,28 +341,28 @@ discard block |
||
341 | 341 | } |
342 | 342 | // set company id as default |
343 | 343 | $main_company = $user->person->company(); |
344 | - if ($main_company !== null && ! $user->isAdmin()) { |
|
344 | + if ($main_company !== null && !$user->isAdmin()) { |
|
345 | 345 | $c_id = $main_company->id; |
346 | 346 | } |
347 | - if(! $user->isAdmin()){ |
|
347 | + if (!$user->isAdmin()) { |
|
348 | 348 | |
349 | 349 | $tenants = Tenant::find($main_company->id); |
350 | 350 | } |
351 | 351 | if ($user->isAdmin()) { |
352 | 352 | $tenants = null; |
353 | 353 | } |
354 | - if ($main_company === null && ! $user->isAdmin()) { |
|
354 | + if ($main_company === null && !$user->isAdmin()) { |
|
355 | 355 | // if (($main_company == null||$tenants=='') && ! $user->isAdmin()) { |
356 | 356 | // if ($main_company == null) { |
357 | 357 | $this->create_company($user); |
358 | 358 | } else { |
359 | - if ($tenants && ! $user->isAdmin()) { |
|
359 | + if ($tenants && !$user->isAdmin()) { |
|
360 | 360 | // $c = DB::connection('tenantdb',$tenants->tenancy_db_name)->table('users')->count(); |
361 | 361 | $company = \App\Models\Company::find($main_company->id); |
362 | 362 | // \Log::debug('Database----------------------'.$main_company->id); |
363 | 363 | |
364 | 364 | tenancy()->initialize($tenants); |
365 | - $tenants->run(function () use ($company, $user) { |
|
365 | + $tenants->run(function() use ($company, $user) { |
|
366 | 366 | // $company->save(); |
367 | 367 | $c = User::count(); |
368 | 368 | if ($c === 0) { |
@@ -391,11 +391,11 @@ discard block |
||
391 | 391 | } |
392 | 392 | // set company id as default |
393 | 393 | $main_company = $user->person->company(); |
394 | - if ($main_company !== null && ! $user->isAdmin()) { |
|
394 | + if ($main_company !== null && !$user->isAdmin()) { |
|
395 | 395 | $c_id = $main_company->id.$user->id; |
396 | 396 | } |
397 | 397 | |
398 | - if ($main_company === null && ! $user->isAdmin()) { |
|
398 | + if ($main_company === null && !$user->isAdmin()) { |
|
399 | 399 | // if ($main_company == null) { |
400 | 400 | $this->create_company($user); |
401 | 401 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | |
44 | 44 | private function emailUnchagedForUser() |
45 | 45 | { |
46 | - return ! optional($this->route('person'))->hasUser() |
|
46 | + return !optional($this->route('person'))->hasUser() |
|
47 | 47 | || $this->get('email') === $this->route('person')->email; |
48 | 48 | } |
49 | 49 | } |
@@ -10,9 +10,9 @@ |
||
10 | 10 | protected $proxies; |
11 | 11 | |
12 | 12 | protected $headers = |
13 | - Request::HEADER_X_FORWARDED_FOR | |
|
14 | - Request::HEADER_X_FORWARDED_HOST | |
|
15 | - Request::HEADER_X_FORWARDED_PORT | |
|
16 | - Request::HEADER_X_FORWARDED_PROTO | |
|
13 | + Request::HEADER_X_FORWARDED_FOR| |
|
14 | + Request::HEADER_X_FORWARDED_HOST| |
|
15 | + Request::HEADER_X_FORWARDED_PORT| |
|
16 | + Request::HEADER_X_FORWARDED_PROTO| |
|
17 | 17 | Request::HEADER_X_FORWARDED_AWS_ELB; |
18 | 18 | } |