@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $array = []; |
| 28 | 28 | |
| 29 | - foreach($this->all() as $field) { |
|
| 29 | + foreach ($this->all() as $field) { |
|
| 30 | 30 | $array[] = $field->toArray(); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | private static function initEmptyFields(array $locales, ProvidesUrl $model): self |
| 42 | 42 | { |
| 43 | 43 | // Add wildcard field as default |
| 44 | - $fields = new static([ $wildCardField = UrlSlugField::make('url-slugs.' . UrlAssistant::WILDCARD) |
|
| 45 | - ->name('url-slugs[' . UrlAssistant::WILDCARD . ']') |
|
| 44 | + $fields = new static([$wildCardField = UrlSlugField::make('url-slugs.'.UrlAssistant::WILDCARD) |
|
| 45 | + ->name('url-slugs['.UrlAssistant::WILDCARD.']') |
|
| 46 | 46 | ->label('') |
| 47 | 47 | ]); |
| 48 | 48 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | ->description('Standaard link die altijd van toepassing is indien er geen taalspecifieke link voorhanden is. Laat deze leeg indien je deze link in bepaalde talen niet wilt beschikbaar maken.'); |
| 54 | 54 | |
| 55 | 55 | foreach ($locales as $locale) { |
| 56 | - $fields['url-slugs.' . $locale] = UrlSlugField::make('url-slugs.' . $locale) |
|
| 56 | + $fields['url-slugs.'.$locale] = UrlSlugField::make('url-slugs.'.$locale) |
|
| 57 | 57 | ->setBaseUrlSegment($model->baseUrlSegment($locale)) |
| 58 | - ->prepend($model->resolveUrl($locale, $model->baseUrlSegment($locale)) .'/') |
|
| 59 | - ->name('url-slugs[' . $locale . ']') |
|
| 60 | - ->label($locale . ' link'); |
|
| 58 | + ->prepend($model->resolveUrl($locale, $model->baseUrlSegment($locale)).'/') |
|
| 59 | + ->name('url-slugs['.$locale.']') |
|
| 60 | + ->label($locale.' link'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | return $fields; |
@@ -69,25 +69,25 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | private static function fillWithExistingValues(ProvidesUrl $model, self $fields): void |
| 71 | 71 | { |
| 72 | - $records = MemoizedUrlRecord::getByModel($model)->reject(function ($record) { |
|
| 72 | + $records = MemoizedUrlRecord::getByModel($model)->reject(function($record) { |
|
| 73 | 73 | return $record->isRedirect(); |
| 74 | 74 | })->sortBy('locale'); |
| 75 | 75 | |
| 76 | 76 | foreach ($records as $record) { |
| 77 | 77 | |
| 78 | 78 | if ($record->isManagedAsWildCard()) { |
| 79 | - $fields['url-slugs.' . UrlAssistant::WILDCARD] |
|
| 79 | + $fields['url-slugs.'.UrlAssistant::WILDCARD] |
|
| 80 | 80 | ->setUrlRecord($record) |
| 81 | 81 | ->setBaseUrlSegment($model->baseUrlSegment($record->locale)); |
| 82 | 82 | continue; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - if(!isset($fields['url-slugs.'.$record->locale])) continue; |
|
| 85 | + if (!isset($fields['url-slugs.'.$record->locale])) continue; |
|
| 86 | 86 | |
| 87 | 87 | $fields['url-slugs.'.$record->locale] |
| 88 | 88 | ->setUrlRecord($record) |
| 89 | 89 | ->setBaseUrlSegment($model->baseUrlSegment($record->locale)) |
| 90 | - ->prepend($model->resolveUrl($record->locale, $model->baseUrlSegment($record->locale)) .'/'); |
|
| 90 | + ->prepend($model->resolveUrl($record->locale, $model->baseUrlSegment($record->locale)).'/'); |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | \ No newline at end of file |