@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | public static function findByToken(string $token) |
35 | 35 | { |
36 | - return self::where('token',$token)->first(); |
|
36 | + return self::where('token', $token)->first(); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function invitee() |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | $flair = 'label--primary'; |
20 | 20 | |
21 | - switch($this->invitation->state()) { |
|
21 | + switch ($this->invitation->state()) { |
|
22 | 22 | case InvitationState::REVOKED: |
23 | 23 | $flair = 'label--error'; |
24 | 24 | break; |
@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | |
22 | 22 | public function index() |
23 | 23 | { |
24 | - if($this->isPreviewAllowed()) |
|
24 | + if ($this->isPreviewAllowed()) |
|
25 | 25 | { |
26 | 26 | $pages = Page::all(); |
27 | - }else{ |
|
27 | + }else { |
|
28 | 28 | $pages = Page::getAllPublished(); |
29 | 29 | } |
30 | 30 | |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | { |
36 | 36 | if ($this->isPreviewAllowed()) { |
37 | 37 | $page = Page::findBySlug($request->slug); |
38 | - } else { |
|
38 | + }else { |
|
39 | 39 | $page = Page::findPublishedBySlug($request->slug); |
40 | 40 | } |
41 | 41 | |
42 | - if(!$page) return redirect()->route('demo.pages.index')->with('note.default', 'Geen resultaten gevonden.'); |
|
42 | + if (!$page) return redirect()->route('demo.pages.index')->with('note.default', 'Geen resultaten gevonden.'); |
|
43 | 43 | |
44 | 44 | return view('demo::pagedetail', compact('page')); |
45 | 45 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | if($this->isPreviewAllowed()) |
25 | 25 | { |
26 | 26 | $pages = Page::all(); |
27 | - }else{ |
|
27 | + } else{ |
|
28 | 28 | $pages = Page::getAllPublished(); |
29 | 29 | } |
30 | 30 | |
@@ -39,7 +39,9 @@ discard block |
||
39 | 39 | $page = Page::findPublishedBySlug($request->slug); |
40 | 40 | } |
41 | 41 | |
42 | - if(!$page) return redirect()->route('demo.pages.index')->with('note.default', 'Geen resultaten gevonden.'); |
|
42 | + if(!$page) { |
|
43 | + return redirect()->route('demo.pages.index')->with('note.default', 'Geen resultaten gevonden.'); |
|
44 | + } |
|
43 | 45 | |
44 | 46 | return view('demo::pagedetail', compact('page')); |
45 | 47 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | foreach ($keys as $key) |
41 | 41 | { |
42 | - if(isset($translation[$key])) |
|
42 | + if (isset($translation[$key])) |
|
43 | 43 | { |
44 | 44 | $attributes[$key] = $translation[$key]; |
45 | 45 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | foreach ($keys as $key) |
63 | 63 | { |
64 | - if(!isset($translation[$key])) continue; |
|
64 | + if (!isset($translation[$key])) continue; |
|
65 | 65 | |
66 | 66 | if (trim($translation[$key])) |
67 | 67 | { |
@@ -61,7 +61,9 @@ |
||
61 | 61 | |
62 | 62 | foreach ($keys as $key) |
63 | 63 | { |
64 | - if(!isset($translation[$key])) continue; |
|
64 | + if(!isset($translation[$key])) { |
|
65 | + continue; |
|
66 | + } |
|
65 | 67 | |
66 | 68 | if (trim($translation[$key])) |
67 | 69 | { |
@@ -24,22 +24,22 @@ |
||
24 | 24 | continue; |
25 | 25 | } |
26 | 26 | |
27 | - foreach($rules as $key => $rule) |
|
27 | + foreach ($rules as $key => $rule) |
|
28 | 28 | { |
29 | - $translationrules['trans.' . $locale . '.'.$key] = $rule; |
|
29 | + $translationrules['trans.'.$locale.'.'.$key] = $rule; |
|
30 | 30 | } |
31 | 31 | |
32 | - foreach($attributes as $key => $attribute) |
|
32 | + foreach ($attributes as $key => $attribute) |
|
33 | 33 | { |
34 | - $translationattributes['trans.' . $locale . '.'.$key] = $attribute; |
|
34 | + $translationattributes['trans.'.$locale.'.'.$key] = $attribute; |
|
35 | 35 | } |
36 | 36 | |
37 | - foreach($messages as $key => $message) |
|
37 | + foreach ($messages as $key => $message) |
|
38 | 38 | { |
39 | - $translationmessages['trans.' . $locale . '.'.$key] = $message; |
|
39 | + $translationmessages['trans.'.$locale.'.'.$key] = $message; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | - $this->validate($request, $translationrules,$translationattributes,$translationmessages); |
|
43 | + $this->validate($request, $translationrules, $translationattributes, $translationmessages); |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | \ No newline at end of file |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | * @param bool $strict false = use fallback locale, true = no result if locale not present |
65 | 65 | * @return null |
66 | 66 | */ |
67 | - public function getTranslationFor($attribute,$locale = null, $strict = true) |
|
67 | + public function getTranslationFor($attribute, $locale = null, $strict = true) |
|
68 | 68 | { |
69 | 69 | // No locale given means we take the current defaulted locale (handled automagically) |
70 | - if(!$locale) return $this->getAttribute($attribute); |
|
70 | + if (!$locale) return $this->getAttribute($attribute); |
|
71 | 71 | |
72 | 72 | if (!$this->hasTranslation($locale) && $strict) return null; |
73 | 73 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $available_locales = static::availableLocales(); |
147 | 147 | $current_locales = $this->translations()->pluck('locale')->toArray(); |
148 | 148 | |
149 | - return array_filter($available_locales, function ($v) use ($current_locales, $available) |
|
149 | + return array_filter($available_locales, function($v) use ($current_locales, $available) |
|
150 | 150 | { |
151 | 151 | return $available ? in_array($v, $current_locales) : !in_array($v, $current_locales); |
152 | 152 | }, ARRAY_FILTER_USE_BOTH); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | { |
162 | 162 | if (!in_array($locale, static::availableLocales())) |
163 | 163 | { |
164 | - throw new InvalidArgumentException('Locale [' . $locale . '] is not available'); |
|
164 | + throw new InvalidArgumentException('Locale ['.$locale.'] is not available'); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function translateForForm($locale, $key) |
215 | 215 | { |
216 | - if(!isset($this->trans) || !isset($this->trans[$locale])) return null; |
|
216 | + if (!isset($this->trans) || !isset($this->trans[$locale])) return null; |
|
217 | 217 | |
218 | 218 | return $this->trans[$locale][$key] ?? null; |
219 | 219 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $is_completely_empty = true; |
252 | 252 | foreach ($keys as $key) |
253 | 253 | { |
254 | - if(!isset($translation[$key])) continue; |
|
254 | + if (!isset($translation[$key])) continue; |
|
255 | 255 | if (trim($translation[$key])) |
256 | 256 | { |
257 | 257 | $is_completely_empty = false; |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $attributes = []; |
271 | 271 | foreach ($keys as $key) |
272 | 272 | { |
273 | - if(isset($translation[$key])) |
|
273 | + if (isset($translation[$key])) |
|
274 | 274 | { |
275 | 275 | $attributes[$key] = $translation[$key]; |
276 | 276 | } |
@@ -67,9 +67,13 @@ discard block |
||
67 | 67 | public function getTranslationFor($attribute,$locale = null, $strict = true) |
68 | 68 | { |
69 | 69 | // No locale given means we take the current defaulted locale (handled automagically) |
70 | - if(!$locale) return $this->getAttribute($attribute); |
|
70 | + if(!$locale) { |
|
71 | + return $this->getAttribute($attribute); |
|
72 | + } |
|
71 | 73 | |
72 | - if (!$this->hasTranslation($locale) && $strict) return null; |
|
74 | + if (!$this->hasTranslation($locale) && $strict) { |
|
75 | + return null; |
|
76 | + } |
|
73 | 77 | |
74 | 78 | return $this->getTranslation($locale)->{$attribute}; |
75 | 79 | } |
@@ -213,7 +217,9 @@ discard block |
||
213 | 217 | */ |
214 | 218 | public function translateForForm($locale, $key) |
215 | 219 | { |
216 | - if(!isset($this->trans) || !isset($this->trans[$locale])) return null; |
|
220 | + if(!isset($this->trans) || !isset($this->trans[$locale])) { |
|
221 | + return null; |
|
222 | + } |
|
217 | 223 | |
218 | 224 | return $this->trans[$locale][$key] ?? null; |
219 | 225 | } |
@@ -251,7 +257,9 @@ discard block |
||
251 | 257 | $is_completely_empty = true; |
252 | 258 | foreach ($keys as $key) |
253 | 259 | { |
254 | - if(!isset($translation[$key])) continue; |
|
260 | + if(!isset($translation[$key])) { |
|
261 | + continue; |
|
262 | + } |
|
255 | 263 | if (trim($translation[$key])) |
256 | 264 | { |
257 | 265 | $is_completely_empty = false; |
@@ -6,9 +6,9 @@ |
||
6 | 6 | { |
7 | 7 | public function getDefaultTranslation($attribute); |
8 | 8 | |
9 | - public function updateTranslation($locale,array $values); |
|
9 | + public function updateTranslation($locale, array $values); |
|
10 | 10 | |
11 | - public function saveTranslation($locale,$attribute,$value); |
|
11 | + public function saveTranslation($locale, $attribute, $value); |
|
12 | 12 | |
13 | 13 | public function removeTranslation($locale); |
14 | 14 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | public function scopeSequence($query) |
10 | 10 | { |
11 | - return $query->orderBy($this->sortableattribute,'ASC'); |
|
11 | + return $query->orderBy($this->sortableattribute, 'ASC'); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public static function reorderAgainstSiblings(array $sequence) |
21 | 21 | { |
22 | - array_walk($sequence,function($id,$i){ |
|
22 | + array_walk($sequence, function($id, $i) { |
|
23 | 23 | self::findOrFail($id)->reorder($i); |
24 | 24 | }); |
25 | 25 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | private function getEnabledField() |
30 | 30 | { |
31 | - if(property_exists($this, 'enablable_field')){ |
|
31 | + if (property_exists($this, 'enablable_field')) { |
|
32 | 32 | return $this->enablable_field; |
33 | 33 | } |
34 | 34 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | private function getEnabledValue() |
40 | 40 | { |
41 | - if(property_exists($this, 'enablable_enabled')){ |
|
41 | + if (property_exists($this, 'enablable_enabled')) { |
|
42 | 42 | return $this->enablable_enabled; |
43 | 43 | } |
44 | 44 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | private function getDisabledValue() |
49 | 49 | { |
50 | - if(property_exists($this, 'enablable_disabled')){ |
|
50 | + if (property_exists($this, 'enablable_disabled')) { |
|
51 | 51 | return $this->enablable_disabled; |
52 | 52 | } |
53 | 53 |