@@ -26,7 +26,7 @@ |
||
26 | 26 | * The block of code inside this directive indicates |
27 | 27 | * the chosen language requests RTL support. |
28 | 28 | */ |
29 | - Blade::if('langrtl', function ($session_identifier = 'lang-rtl') { |
|
29 | + Blade::if ('langrtl', function($session_identifier = 'lang-rtl') { |
|
30 | 30 | return session()->has($session_identifier); |
31 | 31 | }); |
32 | 32 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $accountRepository = $this->app->make(AccountRepository::class); |
38 | 38 | |
39 | 39 | foreach (config('permissions') as $key => $permissions) { |
40 | - Gate::define($key, function (User $user) use ($accountRepository, $key) { |
|
40 | + Gate::define($key, function(User $user) use ($accountRepository, $key) { |
|
41 | 41 | return $accountRepository->hasPermission($user, $key); |
42 | 42 | }); |
43 | 43 | } |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | use Illuminate\Database\Eloquent\Model; |
4 | 4 | |
5 | -if (! function_exists('home_route')) { |
|
5 | +if (!function_exists('home_route')) { |
|
6 | 6 | /** |
7 | 7 | * Return the route to the "home" page depending on authentication/authorization status. |
8 | 8 | * |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | } |
19 | 19 | } |
20 | 20 | |
21 | -if (! function_exists('is_admin_route')) { |
|
21 | +if (!function_exists('is_admin_route')) { |
|
22 | 22 | /** |
23 | 23 | * @param \Illuminate\Http\Request $request |
24 | 24 | * |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | -if (! function_exists('image_template_url')) { |
|
35 | +if (!function_exists('image_template_url')) { |
|
36 | 36 | /** |
37 | 37 | * @param $template |
38 | 38 | * @param $imagePath |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | -if (! function_exists('localize_url')) { |
|
50 | +if (!function_exists('localize_url')) { |
|
51 | 51 | function localize_url($locale = null, $attributes = [], Model $translatable = null) |
52 | 52 | { |
53 | 53 | $url = null; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function create(array $data) |
93 | 93 | { |
94 | - return DB::transaction(function () use ($data) { |
|
94 | + return DB::transaction(function() use ($data) { |
|
95 | 95 | $user = parent::create([ |
96 | 96 | 'first_name' => $data['first_name'], |
97 | 97 | 'last_name' => $data['last_name'], |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | // No image being passed |
152 | 152 | if ($input['avatar_type'] == 'storage') { |
153 | 153 | // If there is no existing image |
154 | - if (! strlen(auth()->user()->avatar_location)) { |
|
154 | + if (!strlen(auth()->user()->avatar_location)) { |
|
155 | 155 | throw new GeneralException('You must supply a profile image.'); |
156 | 156 | } |
157 | 157 | } else { |
@@ -260,9 +260,9 @@ discard block |
||
260 | 260 | * The true flag indicate that it is a social account |
261 | 261 | * Which triggers the script to use some default values in the create method |
262 | 262 | */ |
263 | - if (! $user) { |
|
263 | + if (!$user) { |
|
264 | 264 | // Registration is not enabled |
265 | - if (! config('access.registration')) { |
|
265 | + if (!config('access.registration')) { |
|
266 | 266 | throw new GeneralException(__('exceptions.frontend.auth.registration_disabled')); |
267 | 267 | } |
268 | 268 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | } |
284 | 284 | |
285 | 285 | // See if the user has logged in with this social account before |
286 | - if (! $user->hasProvider($provider)) { |
|
286 | + if (!$user->hasProvider($provider)) { |
|
287 | 287 | // Gather the provider data for saving and associate it with the user |
288 | 288 | $user->providers()->save(new SocialAccount([ |
289 | 289 | 'provider' => $provider, |
@@ -322,12 +322,12 @@ discard block |
||
322 | 322 | $result['last_name'] = null; |
323 | 323 | } |
324 | 324 | |
325 | - if (! empty($parts) && $size == 1) { |
|
325 | + if (!empty($parts) && $size == 1) { |
|
326 | 326 | $result['first_name'] = $parts[0]; |
327 | 327 | $result['last_name'] = null; |
328 | 328 | } |
329 | 329 | |
330 | - if (! empty($parts) && $size >= 2) { |
|
330 | + if (!empty($parts) && $size >= 2) { |
|
331 | 331 | $result['first_name'] = $parts[0]; |
332 | 332 | $result['last_name'] = $parts[1]; |
333 | 333 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | $model = app()->make($this->model()); |
92 | 92 | |
93 | - if (! $model instanceof Model) { |
|
93 | + if (!$model instanceof Model) { |
|
94 | 94 | throw new GeneralException("Class {$this->model()} must be an instance of ".Model::class); |
95 | 95 | } |
96 | 96 | |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | $this->query->orderBy($orders['column'], $orders['direction']); |
433 | 433 | } |
434 | 434 | |
435 | - if (isset($this->take) and ! is_null($this->take)) { |
|
435 | + if (isset($this->take) and !is_null($this->take)) { |
|
436 | 436 | $this->query->take($this->take); |
437 | 437 | } |
438 | 438 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | throw new GeneralException(__('exceptions.backend.form_settings.already_exist')); |
50 | 50 | } |
51 | 51 | |
52 | - if (! $formSetting->save()) { |
|
52 | + if (!$formSetting->save()) { |
|
53 | 53 | throw new GeneralException(__('exceptions.backend.form_settings.create')); |
54 | 54 | } |
55 | 55 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | throw new GeneralException(__('exceptions.backend.form_settings.already_exist')); |
74 | 74 | } |
75 | 75 | |
76 | - if (! $formSetting->update($input)) { |
|
76 | + if (!$formSetting->update($input)) { |
|
77 | 77 | throw new GeneralException(__('exceptions.backend.form_settings.update')); |
78 | 78 | } |
79 | 79 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function destroy(FormSetting $formSetting) |
91 | 91 | { |
92 | - if (! $formSetting->delete()) { |
|
92 | + if (!$formSetting->delete()) { |
|
93 | 93 | throw new GeneralException(__('exceptions.backend.form_settings.delete')); |
94 | 94 | } |
95 | 95 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | throw new GeneralException(__('exceptions.backend.redirections.already_exist')); |
50 | 50 | } |
51 | 51 | |
52 | - if (! $redirection->save()) { |
|
52 | + if (!$redirection->save()) { |
|
53 | 53 | throw new GeneralException(__('exceptions.backend.redirections.create')); |
54 | 54 | } |
55 | 55 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | throw new GeneralException(__('exceptions.backend.redirections.already_exist')); |
74 | 74 | } |
75 | 75 | |
76 | - if (! $redirection->update($input)) { |
|
76 | + if (!$redirection->update($input)) { |
|
77 | 77 | throw new GeneralException(__('exceptions.backend.redirections.update')); |
78 | 78 | } |
79 | 79 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function destroy(Redirection $redirection) |
91 | 91 | { |
92 | - if (! $redirection->delete()) { |
|
92 | + if (!$redirection->delete()) { |
|
93 | 93 | throw new GeneralException(__('exceptions.backend.redirections.delete')); |
94 | 94 | } |
95 | 95 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function batchDestroy(array $ids) |
107 | 107 | { |
108 | - DB::transaction(function () use ($ids) { |
|
108 | + DB::transaction(function() use ($ids) { |
|
109 | 109 | // This wont call eloquent events, change to destroy if needed |
110 | 110 | if ($this->query()->whereIn('id', $ids)->delete()) { |
111 | 111 | return true; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function batchEnable(array $ids) |
128 | 128 | { |
129 | - DB::transaction(function () use ($ids) { |
|
129 | + DB::transaction(function() use ($ids) { |
|
130 | 130 | if ($this->query()->whereIn('id', $ids) |
131 | 131 | ->update(['active' => true]) |
132 | 132 | ) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function batchDisable(array $ids) |
150 | 150 | { |
151 | - DB::transaction(function () use ($ids) { |
|
151 | + DB::transaction(function() use ($ids) { |
|
152 | 152 | if ($this->query()->whereIn('id', $ids) |
153 | 153 | ->update(['active' => false]) |
154 | 154 | ) { |
@@ -114,25 +114,25 @@ discard block |
||
114 | 114 | private function save(Post $post, array $input, UploadedFile $image = null) |
115 | 115 | { |
116 | 116 | if ($post->exists) { |
117 | - if (! Gate::check('update', $post)) { |
|
117 | + if (!Gate::check('update', $post)) { |
|
118 | 118 | throw new GeneralException(__('exceptions.backend.posts.save')); |
119 | 119 | } |
120 | 120 | } else { |
121 | 121 | $post->user_id = auth()->id(); |
122 | 122 | } |
123 | 123 | |
124 | - if (Post::PUBLISHED === $post->status && ! Gate::check('publish posts')) { |
|
124 | + if (Post::PUBLISHED === $post->status && !Gate::check('publish posts')) { |
|
125 | 125 | // User with no publish permissions must go to moderation awaiting |
126 | 126 | $post->status = Post::PENDING; |
127 | 127 | } |
128 | 128 | |
129 | - DB::transaction(function () use ($post, $input, $image) { |
|
130 | - if (! $post->save()) { |
|
129 | + DB::transaction(function() use ($post, $input, $image) { |
|
130 | + if (!$post->save()) { |
|
131 | 131 | throw new GeneralException(__('exceptions.backend.posts.save')); |
132 | 132 | } |
133 | 133 | |
134 | 134 | if (isset($input['meta'])) { |
135 | - if (! $post->meta) { |
|
135 | + if (!$post->meta) { |
|
136 | 136 | $post->meta()->create($input['meta']); |
137 | 137 | } else { |
138 | 138 | $post->meta->update($input['meta']); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $currentFeaturedImage = $post->getMedia('featured image')->first(); |
152 | 152 | |
153 | 153 | // Delete current image if replaced or delete asking |
154 | - if ($currentFeaturedImage && ($image || ! $input['has_featured_image'])) { |
|
154 | + if ($currentFeaturedImage && ($image || !$input['has_featured_image'])) { |
|
155 | 155 | $currentFeaturedImage->delete(); |
156 | 156 | } |
157 | 157 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function destroy(Post $post) |
177 | 177 | { |
178 | - if (! $post->delete()) { |
|
178 | + if (!$post->delete()) { |
|
179 | 179 | throw new GeneralException(__('exceptions.backend.posts.delete')); |
180 | 180 | } |
181 | 181 | |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function batchDestroy(array $ids) |
205 | 205 | { |
206 | - DB::transaction(function () use ($ids) { |
|
206 | + DB::transaction(function() use ($ids) { |
|
207 | 207 | $query = $this->batchQuery($ids); |
208 | 208 | |
209 | - if (! Gate::check('delete posts')) { |
|
209 | + if (!Gate::check('delete posts')) { |
|
210 | 210 | // Filter to only current user's posts |
211 | 211 | $query->whereUserId(auth()->id()); |
212 | 212 | } |
@@ -234,10 +234,10 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function batchPublish(array $ids) |
236 | 236 | { |
237 | - DB::transaction(function () use ($ids) { |
|
237 | + DB::transaction(function() use ($ids) { |
|
238 | 238 | $query = $this->batchQuery($ids); |
239 | 239 | |
240 | - if (! Gate::check('edit posts')) { |
|
240 | + if (!Gate::check('edit posts')) { |
|
241 | 241 | // Filter to only current user's posts |
242 | 242 | $query->whereUserId(auth()->id()); |
243 | 243 | } |
@@ -267,10 +267,10 @@ discard block |
||
267 | 267 | */ |
268 | 268 | public function batchPin(array $ids) |
269 | 269 | { |
270 | - DB::transaction(function () use ($ids) { |
|
270 | + DB::transaction(function() use ($ids) { |
|
271 | 271 | $query = $this->batchQuery($ids); |
272 | 272 | |
273 | - if (! Gate::check('edit posts')) { |
|
273 | + if (!Gate::check('edit posts')) { |
|
274 | 274 | // Filter to only current user's posts |
275 | 275 | $query->whereUserId(auth()->id()); |
276 | 276 | } |
@@ -295,10 +295,10 @@ discard block |
||
295 | 295 | */ |
296 | 296 | public function batchPromote(array $ids) |
297 | 297 | { |
298 | - DB::transaction(function () use ($ids) { |
|
298 | + DB::transaction(function() use ($ids) { |
|
299 | 299 | $query = $this->batchQuery($ids); |
300 | 300 | |
301 | - if (! Gate::check('edit posts')) { |
|
301 | + if (!Gate::check('edit posts')) { |
|
302 | 302 | // Filter to only current user's posts |
303 | 303 | $query->whereUserId(auth()->id()); |
304 | 304 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | throw new GeneralException(__('exceptions.backend.metas.already_exist')); |
51 | 51 | } |
52 | 52 | |
53 | - if (! $meta->save()) { |
|
53 | + if (!$meta->save()) { |
|
54 | 54 | throw new GeneralException(__('exceptions.backend.metas.create')); |
55 | 55 | } |
56 | 56 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | - if (! $meta->update($input)) { |
|
79 | + if (!$meta->update($input)) { |
|
80 | 80 | throw new GeneralException(__('exceptions.backend.metas.update')); |
81 | 81 | } |
82 | 82 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function destroy(Meta $meta) |
94 | 94 | { |
95 | - if (! $meta->delete()) { |
|
95 | + if (!$meta->delete()) { |
|
96 | 96 | throw new GeneralException(__('exceptions.backend.metas.delete')); |
97 | 97 | } |
98 | 98 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function batchDestroy(array $ids) |
110 | 110 | { |
111 | - DB::transaction(function () use ($ids) { |
|
111 | + DB::transaction(function() use ($ids) { |
|
112 | 112 | // This wont call eloquent events, change to destroy if needed |
113 | 113 | if ($this->query()->whereIn('id', $ids)->delete()) { |
114 | 114 | return true; |