@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | public function scopeFeatured($query) |
13 | 13 | { |
14 | - $query->where('featured',1); |
|
14 | + $query->where('featured', 1); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function feature() |
@@ -9,11 +9,11 @@ |
||
9 | 9 | { |
10 | 10 | public function isPreviewAllowed() |
11 | 11 | { |
12 | - if(request()->has('preview-mode') && Auth::guard('chief')->check()) |
|
12 | + if (request()->has('preview-mode') && Auth::guard('chief')->check()) |
|
13 | 13 | { |
14 | 14 | Session::now('note.default', 'U bekijkt een preview.'); |
15 | 15 | return true; |
16 | - }else{ |
|
16 | + }else { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | { |
14 | 14 | Session::now('note.default', 'U bekijkt een preview.'); |
15 | 15 | return true; |
16 | - }else{ |
|
16 | + } else{ |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function children(): Collection |
12 | 12 | { |
13 | - if($this->areChildRelationsLoaded()){ |
|
13 | + if ($this->areChildRelationsLoaded()) { |
|
14 | 14 | return $this->loadedChildRelations; |
15 | 15 | } |
16 | 16 | return $this->loadedChildRelations = Relation::children($this->getMorphClass(), $this->getKey()); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | public function presentChildren(): \Illuminate\Support\Collection |
36 | 36 | { |
37 | - return $this->children()->map(function($child){ |
|
37 | + return $this->children()->map(function($child) { |
|
38 | 38 | return $child->presentForParent($this, $child->relation); |
39 | 39 | }); |
40 | 40 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | ->orderBy('sort', 'ASC') |
18 | 18 | ->get(); |
19 | 19 | |
20 | - return $relations->map(function ($relation) { |
|
20 | + return $relations->map(function($relation) { |
|
21 | 21 | $parent = (new $relation->parent_type)->find($relation->parent_id); |
22 | 22 | $parent->relation = $relation; |
23 | 23 | return $parent; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ->orderBy('sort', 'ASC') |
32 | 32 | ->get(); |
33 | 33 | |
34 | - return $relations->map(function ($relation) { |
|
34 | + return $relations->map(function($relation) { |
|
35 | 35 | $child = (new $relation->child_type)->find($relation->child_id); |
36 | 36 | $child->relation = $relation; |
37 | 37 | return $child; |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | return [ |
50 | 50 | [ |
51 | 51 | 'label' => 'Pagina\'s', |
52 | - 'values' => Page::all()->map(function($page){ |
|
53 | - return ['composite_id' => $page->getMorphClass().'@'.$page->id, 'label' => 'Pagina ' . teaser($page->title, 20, '...')]; |
|
52 | + 'values' => Page::all()->map(function($page) { |
|
53 | + return ['composite_id' => $page->getMorphClass().'@'.$page->id, 'label' => 'Pagina '.teaser($page->title, 20, '...')]; |
|
54 | 54 | })->toArray(), |
55 | 55 | ] |
56 | 56 | ]; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function parents(): Collection |
12 | 12 | { |
13 | - if($this->areParentRelationsLoaded()){ |
|
13 | + if ($this->areParentRelationsLoaded()) { |
|
14 | 14 | return $this->loadedParentRelations; |
15 | 15 | } |
16 | 16 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | 'parent_id' => $parent_id, |
51 | 51 | 'child_type' => $this->getMorphClass(), |
52 | 52 | 'child_id' => $this->getKey(), |
53 | - ],$attributes); |
|
53 | + ], $attributes); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | private function detachParent($parent_type, $parent_id) |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $collection = new static(); |
14 | 14 | |
15 | - foreach($available_children_types as $type) { |
|
15 | + foreach ($available_children_types as $type) { |
|
16 | 16 | $collection = $collection->merge((new $type)->all()); |
17 | 17 | } |
18 | 18 | |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | |
22 | 22 | public static function relationIds(Collection $collection): Collection |
23 | 23 | { |
24 | - return $collection->map(function($entry){ |
|
24 | + return $collection->map(function($entry) { |
|
25 | 25 | return $entry->getRelationId(); |
26 | 26 | }); |
27 | 27 | } |
28 | 28 | |
29 | 29 | public function flattenForSelect() |
30 | 30 | { |
31 | - return $this->map(function(ActsAsChild $child){ |
|
31 | + return $this->map(function(ActsAsChild $child) { |
|
32 | 32 | return [ |
33 | 33 | 'id' => $child->getRelationId(), |
34 | 34 | 'label' => $child->getRelationLabel(), |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $grouped = []; |
43 | 43 | |
44 | 44 | $this->flattenForSelect()->each(function($entry) use(&$grouped){ |
45 | - if(isset($grouped[$entry['group']])){ |
|
45 | + if (isset($grouped[$entry['group']])) { |
|
46 | 46 | $grouped[$entry['group']]['values'][] = $entry; |
47 | - } else{ |
|
47 | + }else { |
|
48 | 48 | $grouped[$entry['group']] = ['group' => $entry['group'], 'values' => [$entry]]; |
49 | 49 | } |
50 | 50 | }); |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | |
56 | 56 | public static function inflate(array $relateds = []): self |
57 | 57 | { |
58 | - if(count($relateds) == 1 && is_null(reset($relateds))) $relateds = []; |
|
58 | + if (count($relateds) == 1 && is_null(reset($relateds))) $relateds = []; |
|
59 | 59 | |
60 | - return (new static($relateds))->map(function($related){ |
|
60 | + return (new static($relateds))->map(function($related) { |
|
61 | 61 | |
62 | - list($type,$id) = explode('@', $related); |
|
62 | + list($type, $id) = explode('@', $related); |
|
63 | 63 | return (new $type)->find($id); |
64 | 64 | |
65 | 65 | }); |
@@ -55,7 +55,9 @@ |
||
55 | 55 | |
56 | 56 | public static function inflate(array $relateds = []): self |
57 | 57 | { |
58 | - if(count($relateds) == 1 && is_null(reset($relateds))) $relateds = []; |
|
58 | + if(count($relateds) == 1 && is_null(reset($relateds))) { |
|
59 | + $relateds = []; |
|
60 | + } |
|
59 | 61 | |
60 | 62 | return (new static($relateds))->map(function($related){ |
61 | 63 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $slug = $originalslug = Str::slug($title); |
28 | 28 | $i = 1; |
29 | 29 | |
30 | - while(!$this->isSlugUnique($slug,$entity)) |
|
30 | + while (!$this->isSlugUnique($slug, $entity)) |
|
31 | 31 | { |
32 | 32 | $slug = $originalslug.'-'.$i; |
33 | 33 | $i++; |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | * @param SluggableContract $entity |
43 | 43 | * @return bool |
44 | 44 | */ |
45 | - private function isSlugUnique($slug,SluggableContract $entity = null) |
|
45 | + private function isSlugUnique($slug, SluggableContract $entity = null) |
|
46 | 46 | { |
47 | 47 | $model = $this->model->findBySlug($slug); |
48 | 48 | |
49 | - if(!$model || ($entity && $entity->id && $model->id == $entity->id)) return true; |
|
49 | + if (!$model || ($entity && $entity->id && $model->id == $entity->id)) return true; |
|
50 | 50 | |
51 | 51 | return false; |
52 | 52 | } |
@@ -46,7 +46,9 @@ |
||
46 | 46 | { |
47 | 47 | $model = $this->model->findBySlug($slug); |
48 | 48 | |
49 | - if(!$model || ($entity && $entity->id && $model->id == $entity->id)) return true; |
|
49 | + if(!$model || ($entity && $entity->id && $model->id == $entity->id)) { |
|
50 | + return true; |
|
51 | + } |
|
50 | 52 | |
51 | 53 | return false; |
52 | 54 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php include(__DIR__ . '/../_partials/header.php'); ?> |
|
1 | +<?php include(__DIR__.'/../_partials/header.php'); ?> |
|
2 | 2 | |
3 | 3 | <section class="column stack-l typography" id="typography"> |
4 | 4 | <h1>Typography</h1> |
@@ -62,4 +62,4 @@ discard block |
||
62 | 62 | |
63 | 63 | </section> |
64 | 64 | |
65 | -<?php include(__DIR__ . '/../_partials/footer.php'); ?> |
|
65 | +<?php include(__DIR__.'/../_partials/footer.php'); ?> |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php include(__DIR__ . '/../_partials/header.php'); ?> |
|
1 | +<?php include(__DIR__.'/../_partials/header.php'); ?> |
|
2 | 2 | |
3 | 3 | <section class="column stack-l color-scheme" id="colorscheme"> |
4 | 4 | <h1>Color Scheme</h1> |
@@ -205,4 +205,4 @@ discard block |
||
205 | 205 | </div> |
206 | 206 | </section> |
207 | 207 | |
208 | -<?php include(__DIR__ . '/../_partials/footer.php'); ?> |
|
209 | 208 | \ No newline at end of file |
209 | +<?php include(__DIR__.'/../_partials/footer.php'); ?> |
|
210 | 210 | \ No newline at end of file |