@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function create(array $data) : User |
101 | 101 | { |
102 | - return DB::transaction(function () use ($data) { |
|
102 | + return DB::transaction(function() use ($data) { |
|
103 | 103 | $user = parent::create([ |
104 | 104 | 'first_name' => $data['first_name'], |
105 | 105 | 'last_name' => $data['last_name'], |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | ]); |
112 | 112 | |
113 | 113 | // See if adding any additional permissions |
114 | - if (! isset($data['permissions']) || ! count($data['permissions'])) { |
|
114 | + if (!isset($data['permissions']) || !count($data['permissions'])) { |
|
115 | 115 | $data['permissions'] = []; |
116 | 116 | } |
117 | 117 | |
118 | 118 | if ($user) { |
119 | 119 | // User must have at least one role |
120 | - if (! count($data['roles'])) { |
|
120 | + if (!count($data['roles'])) { |
|
121 | 121 | throw new GeneralException(__('exceptions.backend.access.users.role_needed_create')); |
122 | 122 | } |
123 | 123 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $user->syncPermissions($data['permissions']); |
127 | 127 | |
128 | 128 | //Send confirmation email if requested and account approval is off |
129 | - if (isset($data['confirmation_email']) && $user->confirmed == 0 && ! config('access.users.requires_approval')) { |
|
129 | + if (isset($data['confirmation_email']) && $user->confirmed == 0 && !config('access.users.requires_approval')) { |
|
130 | 130 | $user->notify(new UserNeedsConfirmation($user->confirmation_code)); |
131 | 131 | } |
132 | 132 | |
@@ -153,11 +153,11 @@ discard block |
||
153 | 153 | $this->checkUserByEmail($user, $data['email']); |
154 | 154 | |
155 | 155 | // See if adding any additional permissions |
156 | - if (! isset($data['permissions']) || ! count($data['permissions'])) { |
|
156 | + if (!isset($data['permissions']) || !count($data['permissions'])) { |
|
157 | 157 | $data['permissions'] = []; |
158 | 158 | } |
159 | 159 | |
160 | - return DB::transaction(function () use ($user, $data) { |
|
160 | + return DB::transaction(function() use ($user, $data) { |
|
161 | 161 | if ($user->update([ |
162 | 162 | 'first_name' => $data['first_name'], |
163 | 163 | 'last_name' => $data['last_name'], |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | */ |
264 | 264 | public function unconfirm(User $user) : User |
265 | 265 | { |
266 | - if (! $user->confirmed) { |
|
266 | + if (!$user->confirmed) { |
|
267 | 267 | throw new GeneralException(__('exceptions.backend.access.users.not_confirmed')); |
268 | 268 | } |
269 | 269 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | throw new GeneralException(__('exceptions.backend.access.users.delete_first')); |
304 | 304 | } |
305 | 305 | |
306 | - return DB::transaction(function () use ($user) { |
|
306 | + return DB::transaction(function() use ($user) { |
|
307 | 307 | // Delete associated relationships |
308 | 308 | $user->passwordHistories()->delete(); |
309 | 309 | $user->providers()->delete(); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | throw new GeneralException('A role already exists with the name '.$data['name']); |
36 | 36 | } |
37 | 37 | |
38 | - if (! isset($data['permissions']) || ! \count($data['permissions'])) { |
|
38 | + if (!isset($data['permissions']) || !\count($data['permissions'])) { |
|
39 | 39 | $data['permissions'] = []; |
40 | 40 | } |
41 | 41 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | throw new GeneralException(__('exceptions.backend.access.roles.needs_permission')); |
45 | 45 | } |
46 | 46 | |
47 | - return DB::transaction(function () use ($data) { |
|
47 | + return DB::transaction(function() use ($data) { |
|
48 | 48 | $role = parent::create(['name' => strtolower($data['name'])]); |
49 | 49 | |
50 | 50 | if ($role) { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | - if (! isset($data['permissions']) || ! \count($data['permissions'])) { |
|
82 | + if (!isset($data['permissions']) || !\count($data['permissions'])) { |
|
83 | 83 | $data['permissions'] = []; |
84 | 84 | } |
85 | 85 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | throw new GeneralException(__('exceptions.backend.access.roles.needs_permission')); |
89 | 89 | } |
90 | 90 | |
91 | - return DB::transaction(function () use ($role, $data) { |
|
91 | + return DB::transaction(function() use ($role, $data) { |
|
92 | 92 | if ($role->update([ |
93 | 93 | 'name' => strtolower($data['name']), |
94 | 94 | ])) { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** @var Role $role */ |
35 | 35 | $role = $this->make($input); |
36 | 36 | |
37 | - if (! $this->save($role, $input)) { |
|
37 | + if (!$this->save($role, $input)) { |
|
38 | 38 | throw new GeneralException(__('exceptions.backend.roles.create')); |
39 | 39 | } |
40 | 40 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $role->fill($input); |
56 | 56 | |
57 | - if (! $this->save($role, $input)) { |
|
57 | + if (!$this->save($role, $input)) { |
|
58 | 58 | throw new GeneralException(__('exceptions.backend.roles.update')); |
59 | 59 | } |
60 | 60 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | private function save(Role $role, array $input) |
73 | 73 | { |
74 | - if (! $role->save($input)) { |
|
74 | + if (!$role->save($input)) { |
|
75 | 75 | return false; |
76 | 76 | } |
77 | 77 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function destroy(Role $role) |
97 | 97 | { |
98 | - if (! $role->delete()) { |
|
98 | + if (!$role->delete()) { |
|
99 | 99 | throw new GeneralException(__('exceptions.backend.roles.delete')); |
100 | 100 | } |
101 | 101 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | $authenticatedUser = auth()->user(); |
111 | 111 | |
112 | - if (! $authenticatedUser) { |
|
112 | + if (!$authenticatedUser) { |
|
113 | 113 | return []; |
114 | 114 | } |
115 | 115 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | /** @var \Illuminate\Support\Collection $permissions */ |
123 | 123 | $permissions = $authenticatedUser->getPermissions(); |
124 | 124 | |
125 | - $roles = $roles->filter(function (Role $role) use ($permissions) { |
|
125 | + $roles = $roles->filter(function(Role $role) use ($permissions) { |
|
126 | 126 | foreach ($role->permissions as $permission) { |
127 | 127 | if (false === $permissions->search($permission, true)) { |
128 | 128 | return false; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /* @var User $user */ |
68 | 68 | $user->last_access_at = Carbon::now(); |
69 | 69 | |
70 | - if (! $user->save()) { |
|
70 | + if (!$user->save()) { |
|
71 | 71 | throw new GeneralException(__('exceptions.backend.users.update')); |
72 | 72 | } |
73 | 73 | |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | /** @var User $user */ |
94 | 94 | $user = $this->users->query()->whereEmail($user_email)->first(); |
95 | 95 | |
96 | - if (! $user) { |
|
96 | + if (!$user) { |
|
97 | 97 | // Registration is not enabled |
98 | - if (! config('account.can_register')) { |
|
98 | + if (!config('account.can_register')) { |
|
99 | 99 | throw new GeneralException(__('exceptions.frontend.auth.registration_disabled')); |
100 | 100 | } |
101 | 101 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | // Save new provider if needed |
110 | - if (! $user->getProvider($provider)) { |
|
110 | + if (!$user->getProvider($provider)) { |
|
111 | 111 | $user->providers()->save(new SocialLogin([ |
112 | 112 | 'provider' => $provider, |
113 | 113 | 'provider_id' => $data->getId(), |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function update(array $input) |
153 | 153 | { |
154 | - if (! config('account.updating_enabled')) { |
|
154 | + if (!config('account.updating_enabled')) { |
|
155 | 155 | throw new GeneralException(__('exceptions.frontend.user.updating_disabled')); |
156 | 156 | } |
157 | 157 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function changePassword($oldPassword, $newPassword) |
175 | 175 | { |
176 | - if (! config('account.updating_enabled')) { |
|
176 | + if (!config('account.updating_enabled')) { |
|
177 | 177 | throw new GeneralException(__('exceptions.frontend.user.updating_disabled')); |
178 | 178 | } |
179 | 179 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | throw new GeneralException(__('exceptions.backend.users.first_user_cannot_be_destroyed')); |
204 | 204 | } |
205 | 205 | |
206 | - if (! $user->delete()) { |
|
206 | + if (!$user->delete()) { |
|
207 | 207 | throw new GeneralException(__('exceptions.frontend.user.delete_account')); |
208 | 208 | } |
209 | 209 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $formSubmission->type = $type; |
43 | 43 | $formSubmission->data = json_encode($input); |
44 | 44 | |
45 | - DB::transaction(function () use ($formSubmission) { |
|
45 | + DB::transaction(function() use ($formSubmission) { |
|
46 | 46 | if ($formSubmission->save()) { |
47 | 47 | event(new FormSubmissionCreated($formSubmission)); |
48 | 48 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function destroy(FormSubmission $formSubmission) |
66 | 66 | { |
67 | - if (! $formSubmission->delete()) { |
|
67 | + if (!$formSubmission->delete()) { |
|
68 | 68 | throw new GeneralException(__('exceptions.backend.form_submissions.delete')); |
69 | 69 | } |
70 | 70 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function batchDestroy(array $ids) |
82 | 82 | { |
83 | - DB::transaction(function () use ($ids) { |
|
83 | + DB::transaction(function() use ($ids) { |
|
84 | 84 | // This wont call eloquent events, change to destroy if needed |
85 | 85 | if ($this->query()->whereIn('id', $ids)->delete()) { |
86 | 86 | return true; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | public function collection() |
31 | 31 | { |
32 | - return $this->query->get($this->columns)->each(function (Model $item) { |
|
32 | + return $this->query->get($this->columns)->each(function(Model $item) { |
|
33 | 33 | return $item->setAppends([]); |
34 | 34 | }); |
35 | 35 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $this->posts->query() |
54 | 54 | ->where('status', '!=', Post::PUBLISHED) |
55 | 55 | ->where('published_at', '<', $now) |
56 | - ->where(function (Builder $q) use ($now) { |
|
56 | + ->where(function(Builder $q) use ($now) { |
|
57 | 57 | $q |
58 | 58 | ->whereNull('unpublished_at') |
59 | 59 | ->orWhere('unpublished_at', '>', $now); |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | public function passes($attribute, $value) |
40 | 40 | { |
41 | 41 | // Option is off |
42 | - if (! config('access.users.password_history')) { |
|
42 | + if (!config('access.users.password_history')) { |
|
43 | 43 | return true; |
44 | 44 | } |
45 | 45 | |
46 | - if (! $this->user instanceof User) { |
|
46 | + if (!$this->user instanceof User) { |
|
47 | 47 | if (is_numeric($this->user)) { |
48 | 48 | $this->user = resolve(BackendUserRepository::class)->getById($this->user); |
49 | 49 | } else { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | - if (! $this->user || null === $this->user) { |
|
54 | + if (!$this->user || null === $this->user) { |
|
55 | 55 | return false; |
56 | 56 | } |
57 | 57 |
@@ -27,41 +27,41 @@ |
||
27 | 27 | |
28 | 28 | $donate = $request->donate*100; |
29 | 29 | $GetTokenParams = [ |
30 | - "checkout" => [ |
|
30 | + "checkout" => [ |
|
31 | 31 | "test" => $is_test, //true, |
32 | 32 | "transaction_type" => "payment", |
33 | 33 | "version" => 2.1, |
34 | 34 | "attempts" => 3, |
35 | 35 | "settings" => [ |
36 | - "success_url" => $url . "message=1", |
|
37 | - "decline_url" => $url . "message=2", |
|
38 | - "fail_url" => $url . "message=3", |
|
39 | - "notification_url" => "https://".$_SERVER['HTTP_HOST']."/doika/payment-record-db-".$id, |
|
40 | - "language"=> "ru" |
|
36 | + "success_url" => $url . "message=1", |
|
37 | + "decline_url" => $url . "message=2", |
|
38 | + "fail_url" => $url . "message=3", |
|
39 | + "notification_url" => "https://".$_SERVER['HTTP_HOST']."/doika/payment-record-db-".$id, |
|
40 | + "language"=> "ru" |
|
41 | 41 | ], |
42 | 42 | "order" =>[ |
43 | - "currency"=> "BYN", |
|
44 | - "amount"=> $donate, |
|
45 | - "description"=> "Order description" |
|
43 | + "currency"=> "BYN", |
|
44 | + "amount"=> $donate, |
|
45 | + "description"=> "Order description" |
|
46 | 46 | ], |
47 | 47 | "customer"=> [ |
48 | - "address"=> "Baker street 221b", |
|
49 | - "country"=> "GB", |
|
50 | - "city"=> "London", |
|
51 | - "email"=> "[email protected]" |
|
48 | + "address"=> "Baker street 221b", |
|
49 | + "country"=> "GB", |
|
50 | + "city"=> "London", |
|
51 | + "email"=> "[email protected]" |
|
52 | 52 | ], |
53 | - ] |
|
53 | + ] |
|
54 | 54 | ]; |
55 | 55 | |
56 | 56 | $client = new Client([ |
57 | - 'base_uri' => "https://checkout.bepaid.by" |
|
57 | + 'base_uri' => "https://checkout.bepaid.by" |
|
58 | 58 | ]); |
59 | 59 | |
60 | 60 | $response = $client->request('POST', '/ctp/api/checkouts', [ |
61 | - 'auth' => [$idMarket, $keyMarket], |
|
62 | - 'headers' => ['Accept' => 'application/json'], |
|
63 | - 'json' => $GetTokenParams, |
|
64 | - 'verify' => false |
|
61 | + 'auth' => [$idMarket, $keyMarket], |
|
62 | + 'headers' => ['Accept' => 'application/json'], |
|
63 | + 'json' => $GetTokenParams, |
|
64 | + 'verify' => false |
|
65 | 65 | ]); |
66 | 66 | return $response->getBody(); |
67 | 67 | } |
@@ -9,23 +9,23 @@ discard block |
||
9 | 9 | class Donation extends Model |
10 | 10 | { |
11 | 11 | |
12 | - static public function getPaymentPage($request,$id){ |
|
12 | + static public function getPaymentPage($request, $id) { |
|
13 | 13 | |
14 | - $idMarket = Doika_configuration::where('configuration_name','id_market') |
|
14 | + $idMarket = Doika_configuration::where('configuration_name', 'id_market') |
|
15 | 15 | ->first()->configuration_value; |
16 | - $keyMarket = Doika_configuration::where('configuration_name','key_market') |
|
16 | + $keyMarket = Doika_configuration::where('configuration_name', 'key_market') |
|
17 | 17 | ->first()->configuration_value; |
18 | - if(Doika_configuration::where('configuration_name','is_test') |
|
19 | - ->first()->configuration_value == 1){ |
|
18 | + if (Doika_configuration::where('configuration_name', 'is_test') |
|
19 | + ->first()->configuration_value == 1) { |
|
20 | 20 | $is_test = true; |
21 | - }else{ |
|
21 | + } else { |
|
22 | 22 | $is_test = false; |
23 | 23 | } |
24 | 24 | |
25 | - $url = isset($request->url) ? urldecode($request->url) : ("https://" . $_SERVER['HTTP_HOST'] . '/'); |
|
25 | + $url = isset($request->url) ? urldecode($request->url) : ("https://".$_SERVER['HTTP_HOST'].'/'); |
|
26 | 26 | $url .= (strpos($url, "?") > 0) ? "&" : "?"; |
27 | 27 | |
28 | - $donate = $request->donate*100; |
|
28 | + $donate = $request->donate * 100; |
|
29 | 29 | $GetTokenParams = [ |
30 | 30 | "checkout" => [ |
31 | 31 | "test" => $is_test, //true, |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | "version" => 2.1, |
34 | 34 | "attempts" => 3, |
35 | 35 | "settings" => [ |
36 | - "success_url" => $url . "message=1", |
|
37 | - "decline_url" => $url . "message=2", |
|
38 | - "fail_url" => $url . "message=3", |
|
36 | + "success_url" => $url."message=1", |
|
37 | + "decline_url" => $url."message=2", |
|
38 | + "fail_url" => $url."message=3", |
|
39 | 39 | "notification_url" => "https://".$_SERVER['HTTP_HOST']."/doika/payment-record-db-".$id, |
40 | 40 | "language"=> "ru" |
41 | 41 | ], |
@@ -18,7 +18,7 @@ |
||
18 | 18 | if(Doika_configuration::where('configuration_name','is_test') |
19 | 19 | ->first()->configuration_value == 1){ |
20 | 20 | $is_test = true; |
21 | - }else{ |
|
21 | + } else{ |
|
22 | 22 | $is_test = false; |
23 | 23 | } |
24 | 24 |