@@ -15,23 +15,23 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function boot() |
| 17 | 17 | { |
| 18 | - Validator::extend('absolute_or_relative_url', function ($attribute, $value, $parameters, $validator) { |
|
| 18 | + Validator::extend('absolute_or_relative_url', function($attribute, $value, $parameters, $validator) { |
|
| 19 | 19 | return starts_with($value, '/') || Validator::make([$attribute => $value], [$attribute => 'url'])->passes(); |
| 20 | 20 | }, 'The :attribute should be a valid url (absolute or relative)'); |
| 21 | 21 | |
| 22 | - Validator::extend('relative_or_secure_url', function ($attribute, $value, $parameters) { |
|
| 22 | + Validator::extend('relative_or_secure_url', function($attribute, $value, $parameters) { |
|
| 23 | 23 | return starts_with($value, '/') || filter_var($value, FILTER_VALIDATE_URL) !== false && starts_with($value, 'https'); |
| 24 | 24 | }, 'The :attribute should be a valid url (relative or https)'); |
| 25 | 25 | |
| 26 | - Validator::extend('web_color', function ($attribute, $value, $parameters, $validator) { |
|
| 26 | + Validator::extend('web_color', function($attribute, $value, $parameters, $validator) { |
|
| 27 | 27 | return preg_match('/^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i', $value); |
| 28 | 28 | }); |
| 29 | 29 | |
| 30 | - Validator::extend('phone_number', function ($attribute, $value, $parameters) { |
|
| 30 | + Validator::extend('phone_number', function($attribute, $value, $parameters) { |
|
| 31 | 31 | return preg_match("/^[+]?[0-9\-\ ]*$/", $value); |
| 32 | 32 | }); |
| 33 | 33 | |
| 34 | - Validator::extend('validBlocks', function ($attribute, $value, $parameters, $validator) { |
|
| 34 | + Validator::extend('validBlocks', function($attribute, $value, $parameters, $validator) { |
|
| 35 | 35 | foreach ($value as $block) { |
| 36 | 36 | $cmsBlock = $this->app->make(BlockRepository::class)->buildFromCmsArray($block, false); |
| 37 | 37 | |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | |
| 80 | 80 | if (!$item && config('translatable.use_property_fallback', false) |
| 81 | 81 | && config('translatable.fallback_locale') != config('app.locale')) { |
| 82 | - $item = (clone $query)->orWhere(function ($query) { |
|
| 82 | + $item = (clone $query)->orWhere(function($query) { |
|
| 83 | 83 | return $query->withActiveTranslations(config('translatable.fallback_locale')); |
| 84 | 84 | })->forFallbackLocaleSlug($slug)->first(); |
| 85 | 85 | |