@@ -20,9 +20,9 @@ |
||
20 | 20 | |
21 | 21 | public function renderMetaTags(): string |
22 | 22 | { |
23 | - return $this->seo()->filter(function ($value, $key) { |
|
23 | + return $this->seo()->filter(function($value, $key) { |
|
24 | 24 | return starts_with($key, 'meta_'); |
25 | - })->map(function ($value, $key) : string { |
|
25 | + })->map(function($value, $key) : string { |
|
26 | 26 | $key = substr($key, 5); |
27 | 27 | $attribute = starts_with($key, 'og:') ? 'property' : 'name'; |
28 | 28 | return "<meta {$attribute}=\"{$key}\" content=\"{$value}\">"; |
@@ -19,7 +19,7 @@ |
||
19 | 19 | /* |
20 | 20 | * Authenticate the user's personal channel... |
21 | 21 | */ |
22 | - Broadcast::channel('App.User.*', function ($user, $userId) { |
|
22 | + Broadcast::channel('App.User.*', function($user, $userId) { |
|
23 | 23 | return (int) $user->id === (int) $userId; |
24 | 24 | }); |
25 | 25 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | return $constants; |
107 | 107 | } |
108 | 108 | |
109 | - return array_filter($constants, function ($key) use ($startsWithFilter) { |
|
109 | + return array_filter($constants, function($key) use ($startsWithFilter) { |
|
110 | 110 | return starts_with(strtolower($key), strtolower($startsWithFilter)); |
111 | 111 | }, ARRAY_FILTER_USE_KEY); |
112 | 112 | } |
@@ -152,15 +152,13 @@ discard block |
||
152 | 152 | function login_url(): string |
153 | 153 | { |
154 | 154 | return request()->isFront() ? |
155 | - action('Front\Auth\LoginController@showLoginForm') : |
|
156 | - action('Back\Auth\LoginController@showLoginForm'); |
|
155 | + action('Front\Auth\LoginController@showLoginForm') : action('Back\Auth\LoginController@showLoginForm'); |
|
157 | 156 | } |
158 | 157 | |
159 | 158 | function logout_url(): string |
160 | 159 | { |
161 | 160 | return request()->isFront() ? |
162 | - action('Front\Auth\LoginController@logout') : |
|
163 | - action('Back\Auth\LoginController@logout'); |
|
161 | + action('Front\Auth\LoginController@logout') : action('Back\Auth\LoginController@logout'); |
|
164 | 162 | } |
165 | 163 | |
166 | 164 | function register_url(): string |
@@ -197,7 +195,7 @@ discard block |
||
197 | 195 | function rgb_to_hex(int $red, int $green, int $blue): string |
198 | 196 | { |
199 | 197 | return '#'.collect([$red, $green, $blue]) |
200 | - ->map(function (int $decimal) : string { |
|
198 | + ->map(function(int $decimal) : string { |
|
201 | 199 | return str_pad(dechex($decimal), 2, STR_PAD_LEFT); |
202 | 200 | }) |
203 | 201 | ->implode(''); |
@@ -13,12 +13,12 @@ |
||
13 | 13 | { |
14 | 14 | public function subscribe(Dispatcher $events) |
15 | 15 | { |
16 | - $events->listen(UserRegistered::class, function (UserRegistered $event) { |
|
16 | + $events->listen(UserRegistered::class, function(UserRegistered $event) { |
|
17 | 17 | Mail::send(new Welcome($event->user)); |
18 | 18 | }); |
19 | 19 | |
20 | - $events->listen(UserCreatedThroughBack::class, function (UserCreatedThroughBack $event) { |
|
21 | - Password::broker('front')->sendResetLink(['email' => $event->user->email], function (Message $message) { |
|
20 | + $events->listen(UserCreatedThroughBack::class, function(UserCreatedThroughBack $event) { |
|
21 | + Password::broker('front')->sendResetLink(['email' => $event->user->email], function(Message $message) { |
|
22 | 22 | $message->subject('Welkom bij '.config('app.url')); |
23 | 23 | }); |
24 | 24 | }); |
@@ -245,11 +245,11 @@ discard block |
||
245 | 245 | |
246 | 246 | public function seo(): string |
247 | 247 | { |
248 | - return locales()->map(function ($locale) { |
|
248 | + return locales()->map(function($locale) { |
|
249 | 249 | |
250 | 250 | return collect($this->model->defaultSeoValues()) |
251 | 251 | ->keys() |
252 | - ->map(function ($attribute) use ($locale) { |
|
252 | + ->map(function($attribute) use ($locale) { |
|
253 | 253 | |
254 | 254 | $fieldName = translate_field_name("seo.{$attribute}", $locale); |
255 | 255 | |
@@ -258,11 +258,11 @@ discard block |
||
258 | 258 | Form::text( |
259 | 259 | $fieldName, |
260 | 260 | old($fieldName, $this->model->getTranslation('seo_values', $locale)[$attribute] ?? ''), |
261 | - [ 'placeholder' => $this->model->defaultSeoValues()[$attribute] ] |
|
261 | + ['placeholder' => $this->model->defaultSeoValues()[$attribute]] |
|
262 | 262 | ), |
263 | 263 | ]); |
264 | 264 | }) |
265 | - ->pipe(function (Collection $fields) use ($locale) { |
|
265 | + ->pipe(function(Collection $fields) use ($locale) { |
|
266 | 266 | return $this->languageFieldSet($locale, $fields->toArray()); |
267 | 267 | }); |
268 | 268 | })->implode(''); |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | |
21 | 21 | $files = $request->file('file'); |
22 | 22 | |
23 | - if (! is_array($files)) { |
|
23 | + if (!is_array($files)) { |
|
24 | 24 | $files = [$files]; |
25 | 25 | } |
26 | 26 | |
27 | 27 | $media = collect($files) |
28 | - ->map(function (UploadedFile $file) use ($model, $request) { |
|
28 | + ->map(function(UploadedFile $file) use ($model, $request) { |
|
29 | 29 | return $model |
30 | 30 | ->addMedia($file) |
31 | 31 | ->withCustomProperties(['temp' => $request->has('redactor') ? false : true]) |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $collectionName = $request->get('collectionName'); |
47 | 47 | |
48 | - $media = $model->getMedia($collectionName)->reduce(function (Collection $collection, Media $media) { |
|
48 | + $media = $model->getMedia($collectionName)->reduce(function(Collection $collection, Media $media) { |
|
49 | 49 | return $collection->push([ |
50 | 50 | 'thumb' => $media->getUrl('admin'), |
51 | 51 | 'image' => $media->getUrl('redactor'), |
@@ -13,14 +13,14 @@ discard block |
||
13 | 13 | protected function updateSeoValues(Model $model, FormRequest $request) |
14 | 14 | { |
15 | 15 | collect($request->all()) |
16 | - ->filter(function ($value, $fieldName) { |
|
16 | + ->filter(function($value, $fieldName) { |
|
17 | 17 | // Filter out everything that starts with 'translated_<locale>_seo_' |
18 | 18 | return Regex::match('/^translated_([a-z][a-z])_seo_/', $fieldName)->hasMatch(); |
19 | 19 | }) |
20 | - ->map(function ($value, $fieldName) { |
|
20 | + ->map(function($value, $fieldName) { |
|
21 | 21 | |
22 | 22 | // Replace 'translated_<locale>_seo_<attribute>' with '<locale>_<attribute>' |
23 | - $localeAndAttribute = Regex::replace('/translated_([a-z][a-z])_seo_/', function (MatchResult $matchResult) { |
|
23 | + $localeAndAttribute = Regex::replace('/translated_([a-z][a-z])_seo_/', function(MatchResult $matchResult) { |
|
24 | 24 | return $matchResult->group(1).'_'; |
25 | 25 | }, $fieldName)->result(); |
26 | 26 | |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | ]; |
34 | 34 | }) |
35 | 35 | ->groupBy('locale') |
36 | - ->map(function (Collection $valuesInLocale) { |
|
37 | - return $valuesInLocale->mapToAssoc(function ($values) { |
|
36 | + ->map(function(Collection $valuesInLocale) { |
|
37 | + return $valuesInLocale->mapToAssoc(function($values) { |
|
38 | 38 | return [$values['attribute'], $values['value']]; |
39 | 39 | }); |
40 | 40 | }) |
41 | - ->each(function ($values, $locale) use ($model) { |
|
41 | + ->each(function($values, $locale) use ($model) { |
|
42 | 42 | $model->setTranslation('seo_values', $locale, $values); |
43 | 43 | }); |
44 | 44 | } |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | { |
11 | 11 | protected function updateMedia(Model $model, FormRequest $request) |
12 | 12 | { |
13 | - if (! isset($model->mediaLibraryCollections)) { |
|
13 | + if (!isset($model->mediaLibraryCollections)) { |
|
14 | 14 | return; |
15 | 15 | } |
16 | 16 | |
17 | 17 | foreach ($model->mediaLibraryCollections as $collection) { |
18 | - if (! $request->has($collection)) { |
|
18 | + if (!$request->has($collection)) { |
|
19 | 19 | continue; |
20 | 20 | } |
21 | 21 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $collection |
25 | 25 | ); |
26 | 26 | |
27 | - collect($updatedMedia)->each(function (Media $media) { |
|
27 | + collect($updatedMedia)->each(function(Media $media) { |
|
28 | 28 | $media->setCustomProperty('temp', false); |
29 | 29 | $media->save(); |
30 | 30 | }); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $model->tags()->detach(); |
15 | 15 | |
16 | 16 | foreach ($model->tagTypes as $type) { |
17 | - collect($request->get("{$type}_tags"))->each(function ($name) use ($model, $type) { |
|
17 | + collect($request->get("{$type}_tags"))->each(function($name) use ($model, $type) { |
|
18 | 18 | $type = new TagType($type); |
19 | 19 | |
20 | 20 | $tag = Tag::findByNameOrCreate($name, $type); |