@@ -113,7 +113,7 @@ |
||
| 113 | 113 | |
| 114 | 114 | $params = ['fp-x' => $fpX, 'fp-y' => $fpY, 'fp-z' => $fpZ]; |
| 115 | 115 | |
| 116 | - return array_map(function ($param) { |
|
| 116 | + return array_map(function($param) { |
|
| 117 | 117 | return number_format($param, 4, ".", ""); |
| 118 | 118 | }, $params) + ['crop' => 'focalpoint', 'fit' => 'crop']; |
| 119 | 119 | } |
@@ -13,11 +13,11 @@ |
||
| 13 | 13 | |
| 14 | 14 | public function renderBlocks($renderChilds = true, $blockViewMappings = [], $data = []) |
| 15 | 15 | { |
| 16 | - return $this->blocks->where('parent_id', null)->map(function ($block) use ($blockViewMappings, $renderChilds, $data) { |
|
| 16 | + return $this->blocks->where('parent_id', null)->map(function($block) use ($blockViewMappings, $renderChilds, $data) { |
|
| 17 | 17 | if ($renderChilds) { |
| 18 | 18 | $childBlocks = $this->blocks->where('parent_id', $block->id); |
| 19 | 19 | |
| 20 | - $renderedChildViews = $childBlocks->map(function ($childBlock) use ($blockViewMappings, $data) { |
|
| 20 | + $renderedChildViews = $childBlocks->map(function($childBlock) use ($blockViewMappings, $data) { |
|
| 21 | 21 | $view = $this->getBlockView($childBlock->type, $blockViewMappings); |
| 22 | 22 | return view($view, $data)->with('block', $childBlock)->render(); |
| 23 | 23 | })->implode(''); |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | |
| 8 | 8 | protected static function bootHasPosition() |
| 9 | 9 | { |
| 10 | - static::creating(function ($model) { |
|
| 10 | + static::creating(function($model) { |
|
| 11 | 11 | $model->setToLastPosition(); |
| 12 | 12 | }); |
| 13 | 13 | } |
@@ -32,12 +32,12 @@ |
||
| 32 | 32 | public function scopeVisible($query) |
| 33 | 33 | { |
| 34 | 34 | if ($this->isFillable('publish_start_date')) { |
| 35 | - $query->where(function ($query) { |
|
| 35 | + $query->where(function($query) { |
|
| 36 | 36 | $query->whereNull('publish_start_date')->orWhere('publish_start_date', '<=', Carbon::now()); |
| 37 | 37 | }); |
| 38 | 38 | |
| 39 | 39 | if ($this->isFillable('publish_end_date')) { |
| 40 | - $query->where(function ($query) { |
|
| 40 | + $query->where(function($query) { |
|
| 41 | 41 | $query->whereNull('publish_end_date')->orWhere('publish_end_date', '>=', Carbon::now()); |
| 42 | 42 | }); |
| 43 | 43 | } |
@@ -14,8 +14,8 @@ |
||
| 14 | 14 | public function rules() |
| 15 | 15 | { |
| 16 | 16 | switch ($this->method()) { |
| 17 | - case 'POST':{return $this->rulesForCreate();} |
|
| 18 | - case 'PUT':{return $this->rulesForUpdate();} |
|
| 17 | + case 'POST':{return $this->rulesForCreate(); } |
|
| 18 | + case 'PUT':{return $this->rulesForUpdate(); } |
|
| 19 | 19 | default:break; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | if (!empty($ids)) { |
| 48 | 48 | foreach ($ids as $id) { |
| 49 | - $tagQuery->whereHas('tagged', function ($query) use ($id) { |
|
| 49 | + $tagQuery->whereHas('tagged', function($query) use ($id) { |
|
| 50 | 50 | $query->where('taggable_id', $id); |
| 51 | 51 | }); |
| 52 | 52 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function getTagsList() |
| 59 | 59 | { |
| 60 | - return $this->getTagsQuery()->where('count', '>', 0)->select('name', 'id')->get()->map(function ($tag) { |
|
| 60 | + return $this->getTagsQuery()->where('count', '>', 0)->select('name', 'id')->get()->map(function($tag) { |
|
| 61 | 61 | return [ |
| 62 | 62 | 'label' => $tag->name, |
| 63 | 63 | 'value' => $tag->id, |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | { |
| 6 | 6 | if (!app()->environment('local', 'development')) { |
| 7 | 7 | try { |
| 8 | - $manifest = Cache::rememberForever('rev-manifest', function () { |
|
| 8 | + $manifest = Cache::rememberForever('rev-manifest', function() { |
|
| 9 | 9 | return json_decode(file_get_contents(config('twill.frontend.rev_manifest_path')), true); |
| 10 | 10 | }); |
| 11 | 11 | |
@@ -16,23 +16,23 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function boot() |
| 18 | 18 | { |
| 19 | - Validator::extend('absolute_or_relative_url', function ($attribute, $value, $parameters, $validator) { |
|
| 19 | + Validator::extend('absolute_or_relative_url', function($attribute, $value, $parameters, $validator) { |
|
| 20 | 20 | return Str::startsWith($value, '/') || Validator::make([$attribute => $value], [$attribute => 'url'])->passes(); |
| 21 | 21 | }, 'The :attribute should be a valid url (absolute or relative)'); |
| 22 | 22 | |
| 23 | - Validator::extend('relative_or_secure_url', function ($attribute, $value, $parameters) { |
|
| 23 | + Validator::extend('relative_or_secure_url', function($attribute, $value, $parameters) { |
|
| 24 | 24 | return Str::startsWith($value, '/') || filter_var($value, FILTER_VALIDATE_URL) !== false && Str::startsWith($value, 'https'); |
| 25 | 25 | }, 'The :attribute should be a valid url (relative or https)'); |
| 26 | 26 | |
| 27 | - Validator::extend('web_color', function ($attribute, $value, $parameters, $validator) { |
|
| 27 | + Validator::extend('web_color', function($attribute, $value, $parameters, $validator) { |
|
| 28 | 28 | return preg_match('/^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i', $value); |
| 29 | 29 | }); |
| 30 | 30 | |
| 31 | - Validator::extend('phone_number', function ($attribute, $value, $parameters) { |
|
| 31 | + Validator::extend('phone_number', function($attribute, $value, $parameters) { |
|
| 32 | 32 | return preg_match("/^[+]?[0-9\-\ ]*$/", $value); |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | - Validator::extend('validBlocks', function ($attribute, $value, $parameters, $validator) { |
|
| 35 | + Validator::extend('validBlocks', function($attribute, $value, $parameters, $validator) { |
|
| 36 | 36 | foreach ($value as $block) { |
| 37 | 37 | $cmsBlock = $this->app->get(BlockRepository::class)->buildFromCmsArray($block, false); |
| 38 | 38 | |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $manageMultipleLanguages = count(getLocales()) > 1; |
| 24 | 24 | if ($manageMultipleLanguages && $translate) { |
| 25 | - $allLanguages = Collection::make(config('translatable.locales'))->map(function ($locale, $index) use ($form_fields) { |
|
| 25 | + $allLanguages = Collection::make(config('translatable.locales'))->map(function($locale, $index) use ($form_fields) { |
|
| 26 | 26 | return [ |
| 27 | 27 | 'shortlabel' => strtoupper($locale), |
| 28 | 28 | 'label' => getLanguageLabelFromLocaleCode($locale), |