@@ -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, |
@@ -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), |
@@ -6,7 +6,7 @@ |
||
6 | 6 | if (!function_exists('dumpUsableSqlQuery')) { |
7 | 7 | function dumpUsableSqlQuery($query) |
8 | 8 | { |
9 | - dd(vsprintf(str_replace('?', '%s', $query->toSql()), array_map(function ($binding) { |
|
9 | + dd(vsprintf(str_replace('?', '%s', $query->toSql()), array_map(function($binding) { |
|
10 | 10 | return is_numeric($binding) ? $binding : "'{$binding}'"; |
11 | 11 | }, $query->getBindings()))); |
12 | 12 | } |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | |
25 | 25 | public function __construct(array $attributes = []) |
26 | 26 | { |
27 | - $this->fillable(array_merge($this->fillable, Collection::make(config('twill.media_library.extra_metadatas_fields'))->map(function ($field) { |
|
27 | + $this->fillable(array_merge($this->fillable, Collection::make(config('twill.media_library.extra_metadatas_fields'))->map(function($field) { |
|
28 | 28 | return $field['name']; |
29 | 29 | })->toArray())); |
30 | 30 | |
31 | - Collection::make(config('twill.media_library.translatable_metadatas_fields'))->each(function ($field) { |
|
31 | + Collection::make(config('twill.media_library.translatable_metadatas_fields'))->each(function($field) { |
|
32 | 32 | $this->casts[$field] = 'json'; |
33 | 33 | }); |
34 | 34 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'medium' => ImageService::getUrl($this->uuid, ["h" => "430"]), |
66 | 66 | 'width' => $this->width, |
67 | 67 | 'height' => $this->height, |
68 | - 'tags' => $this->tags->map(function ($tag) { |
|
68 | + 'tags' => $this->tags->map(function($tag) { |
|
69 | 69 | return $tag->name; |
70 | 70 | }), |
71 | 71 | 'deleteUrl' => $this->canDeleteSafely() ? moduleRoute('medias', 'media-library', 'destroy', $this->id) : null, |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | 'caption' => $this->caption, |
78 | 78 | 'altText' => $this->alt_text, |
79 | 79 | 'video' => null, |
80 | - ] + Collection::make(config('twill.media_library.extra_metadatas_fields'))->mapWithKeys(function ($field) { |
|
80 | + ] + Collection::make(config('twill.media_library.extra_metadatas_fields'))->mapWithKeys(function($field) { |
|
81 | 81 | return [ |
82 | 82 | $field['name'] => $this->{$field['name']}, |
83 | 83 | ]; |