| @@ -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 | |
| @@ -12,15 +12,15 @@ discard block | ||
| 12 | 12 | |
| 13 | 13 | protected static function bootHasSlug() | 
| 14 | 14 |      { | 
| 15 | -        static::created(function ($model) { | |
| 15 | +        static::created(function($model) { | |
| 16 | 16 | $model->setSlugs(); | 
| 17 | 17 | }); | 
| 18 | 18 | |
| 19 | -        static::updated(function ($model) { | |
| 19 | +        static::updated(function($model) { | |
| 20 | 20 | $model->setSlugs(); | 
| 21 | 21 | }); | 
| 22 | 22 | |
| 23 | -        static::restored(function ($model) { | |
| 23 | +        static::restored(function($model) { | |
| 24 | 24 | $model->setSlugs($restoring = true); | 
| 25 | 25 | }); | 
| 26 | 26 | } | 
| @@ -45,7 +45,7 @@ discard block | ||
| 45 | 45 | |
| 46 | 46 | public function scopeForSlug($query, $slug) | 
| 47 | 47 |      { | 
| 48 | -        return $query->whereHas('slugs', function ($query) use ($slug) { | |
| 48 | +        return $query->whereHas('slugs', function($query) use ($slug) { | |
| 49 | 49 | $query->whereSlug($slug); | 
| 50 | 50 | $query->whereActive(true); | 
| 51 | 51 | $query->whereLocale(app()->getLocale()); | 
| @@ -54,7 +54,7 @@ discard block | ||
| 54 | 54 | |
| 55 | 55 | public function scopeForInactiveSlug($query, $slug) | 
| 56 | 56 |      { | 
| 57 | -        return $query->whereHas('slugs', function ($query) use ($slug) { | |
| 57 | +        return $query->whereHas('slugs', function($query) use ($slug) { | |
| 58 | 58 | $query->whereSlug($slug); | 
| 59 | 59 | $query->whereLocale(app()->getLocale()); | 
| 60 | 60 | })->with(['slugs']); | 
| @@ -62,7 +62,7 @@ discard block | ||
| 62 | 62 | |
| 63 | 63 | public function scopeForFallbackLocaleSlug($query, $slug) | 
| 64 | 64 |      { | 
| 65 | -        return $query->whereHas('slugs', function ($query) use ($slug) { | |
| 65 | +        return $query->whereHas('slugs', function($query) use ($slug) { | |
| 66 | 66 | $query->whereSlug($slug); | 
| 67 | 67 | $query->whereActive(true); | 
| 68 | 68 |              $query->whereLocale(config('translatable.fallback_locale')); | 
| @@ -105,7 +105,7 @@ discard block | ||
| 105 | 105 |          foreach ($slugParams as $key => $value) { | 
| 106 | 106 | //check variations of the slug | 
| 107 | 107 |              if ($key == 'slug') { | 
| 108 | -                $query->where(function ($query) use ($value) { | |
| 108 | +                $query->where(function($query) use ($value) { | |
| 109 | 109 |                      $query->orWhere('slug', $value); | 
| 110 | 110 |                      $query->orWhere('slug', $value . '-' . $this->getSuffixSlug()); | 
| 111 | 111 |                      for ($i = 2; $i <= $this->nb_variation_slug; $i++) { | 
| @@ -174,14 +174,14 @@ discard block | ||
| 174 | 174 | |
| 175 | 175 | public function getActiveSlug($locale = null) | 
| 176 | 176 |      { | 
| 177 | -        return $this->slugs->first(function ($slug) use ($locale) { | |
| 177 | +        return $this->slugs->first(function($slug) use ($locale) { | |
| 178 | 178 | return ($slug->locale === ($locale ?? app()->getLocale())) && $slug->active; | 
| 179 | 179 | }) ?? null; | 
| 180 | 180 | } | 
| 181 | 181 | |
| 182 | 182 | public function getFallbackActiveSlug() | 
| 183 | 183 |      { | 
| 184 | -        return $this->slugs->first(function ($slug) { | |
| 184 | +        return $this->slugs->first(function($slug) { | |
| 185 | 185 |              return $slug->locale === config('translatable.fallback_locale') && $slug->active; | 
| 186 | 186 | }) ?? null; | 
| 187 | 187 | } | 
| @@ -11,14 +11,14 @@ | ||
| 11 | 11 | |
| 12 | 12 | public function scopeMine($query) | 
| 13 | 13 |      { | 
| 14 | -        return $query->whereHas('revisions', function ($query) { | |
| 14 | +        return $query->whereHas('revisions', function($query) { | |
| 15 | 15 |              $query->where('user_id', auth('twill_users')->user()->id); | 
| 16 | 16 | }); | 
| 17 | 17 | } | 
| 18 | 18 | |
| 19 | 19 | public function revisionsArray() | 
| 20 | 20 |      { | 
| 21 | -        return $this->revisions->map(function ($revision) { | |
| 21 | +        return $this->revisions->map(function($revision) { | |
| 22 | 22 | return [ | 
| 23 | 23 | 'id' => $revision->id, | 
| 24 | 24 | 'author' => $revision->user->name ?? 'Unknown', |