@@ -12,7 +12,7 @@ |
||
| 12 | 12 | if (request()->has('preview-mode') && Auth::guard('chief')->check()) { |
| 13 | 13 | Session::now('note.default', 'U bekijkt een preview.'); |
| 14 | 14 | return true; |
| 15 | - } else { |
|
| 15 | + }else { |
|
| 16 | 16 | return false; |
| 17 | 17 | } |
| 18 | 18 | } |
@@ -19,7 +19,7 @@ |
||
| 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 | } |
@@ -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(), |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $grouped = []; |
| 43 | 43 | |
| 44 | - $this->flattenForSelect()->each(function ($entry) use (&$grouped) { |
|
| 44 | + $this->flattenForSelect()->each(function($entry) use (&$grouped) { |
|
| 45 | 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 | }); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $relateds = []; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - return (new static($relateds))->map(function ($related) { |
|
| 62 | + return (new static($relateds))->map(function($related) { |
|
| 63 | 63 | list($type, $id) = explode('@', $related); |
| 64 | 64 | return (new $type)->find($id); |
| 65 | 65 | }); |
@@ -34,7 +34,7 @@ |
||
| 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 | ]; |
@@ -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 | return $available ? in_array($v, $current_locales) : !in_array($v, $current_locales); |
| 151 | 151 | }, ARRAY_FILTER_USE_BOTH); |
| 152 | 152 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | private function validateLocale($locale) |
| 160 | 160 | { |
| 161 | 161 | if (!in_array($locale, static::availableLocales())) { |
| 162 | - throw new InvalidArgumentException('Locale [' . $locale . '] is not available'); |
|
| 162 | + throw new InvalidArgumentException('Locale ['.$locale.'] is not available'); |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
@@ -23,15 +23,15 @@ |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | foreach ($rules as $key => $rule) { |
| 26 | - $translationrules['trans.' . $locale . '.'.$key] = $rule; |
|
| 26 | + $translationrules['trans.'.$locale.'.'.$key] = $rule; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | foreach ($attributes as $key => $attribute) { |
| 30 | - $translationattributes['trans.' . $locale . '.'.$key] = $attribute; |
|
| 30 | + $translationattributes['trans.'.$locale.'.'.$key] = $attribute; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | foreach ($messages as $key => $message) { |
| 34 | - $translationmessages['trans.' . $locale . '.'.$key] = $message; |
|
| 34 | + $translationmessages['trans.'.$locale.'.'.$key] = $message; |
|
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
@@ -19,15 +19,15 @@ |
||
| 19 | 19 | { |
| 20 | 20 | $abilities = ['view', 'create', 'update', 'delete']; |
| 21 | 21 | |
| 22 | - return array_map(function ($val) use ($scope) { |
|
| 23 | - return $val . '-'. $scope; |
|
| 22 | + return array_map(function($val) use ($scope) { |
|
| 23 | + return $val.'-'.$scope; |
|
| 24 | 24 | }, $abilities); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public static function getPermissionsForIndex() |
| 28 | 28 | { |
| 29 | 29 | $permissions = $temp = []; |
| 30 | - self::all()->each(function ($permission) use (&$permissions, &$temp) { |
|
| 30 | + self::all()->each(function($permission) use (&$permissions, &$temp) { |
|
| 31 | 31 | $model = explode("_", $permission->name, 2)[1]; |
| 32 | 32 | $temp[$model][$permission->id] = explode("_", $permission->name, 2)[0]; |
| 33 | 33 | $permissions = $temp; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | Permission::findOrCreate($permission, 'chief'); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - $this->info('Permissions ' . implode(', ', $permissions) . ' created.'); |
|
| 42 | + $this->info('Permissions '.implode(', ', $permissions).' created.'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | foreach ($roleNames as $roleName) { |
| 57 | 57 | if ($role = Role::where('name', trim($roleName))->first()) { |
| 58 | 58 | $role->syncPermissions($permissions); |
| 59 | - $this->info('Role ' . $roleName . ' assigned the given permissions.'); |
|
| 60 | - } else { |
|
| 61 | - $this->warn('Role not found by name ' . $roleName . '!'); |
|
| 59 | + $this->info('Role '.$roleName.' assigned the given permissions.'); |
|
| 60 | + }else { |
|
| 61 | + $this->warn('Role not found by name '.$roleName.'!'); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | } |