@@ -95,11 +95,11 @@ |
||
95 | 95 | public function present() |
96 | 96 | { |
97 | 97 | $options = []; |
98 | - foreach(unserialize($this->fieldOptions) as $o) |
|
98 | + foreach (unserialize($this->fieldOptions) as $o) |
|
99 | 99 | { |
100 | 100 | $options[$o] = $o; |
101 | 101 | } |
102 | - return Field::select($this->fieldSlug, $options , $this->value, ['label' => $this->fieldName, 'class' => 'select2']); |
|
102 | + return Field::select($this->fieldSlug, $options, $this->value, ['label' => $this->fieldName, 'class' => 'select2']); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | public function presentFront() |
123 | 123 | { |
124 | 124 | $options = unserialize($this->fieldOptions); |
125 | - if(isset($options['transform'])){ |
|
125 | + if (isset($options['transform'])) { |
|
126 | 126 | return $this->transformText($options['transform']); |
127 | 127 | } |
128 | 128 | return strtoupper($this->value); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | protected function transformText($transformation) |
136 | 136 | { |
137 | - switch ($transformation){ |
|
137 | + switch ($transformation) { |
|
138 | 138 | case "1": |
139 | 139 | return strtoupper($this->value); |
140 | 140 | case "2": |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function addMenuDefinition($class) |
30 | 30 | { |
31 | - if(class_exists($class)) { |
|
31 | + if (class_exists($class)) { |
|
32 | 32 | $this->groups->push($class); |
33 | 33 | } |
34 | 34 | } |
@@ -39,37 +39,37 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function render($group = 'sidebar') |
41 | 41 | { |
42 | - $this->groups->each(function($class){ |
|
42 | + $this->groups->each(function($class) { |
|
43 | 43 | $definition = app($class); |
44 | 44 | $menu = app('menu')->instance($definition->getInstance()); |
45 | - if($definition->isDropdown()) { |
|
45 | + if ($definition->isDropdown()) { |
|
46 | 46 | $menu->dropdown($definition->getName(), function($sub) use ($definition) { |
47 | 47 | $definition->items->each(function($item) use ($sub) { |
48 | - if($item['type'] == 'route') { |
|
48 | + if ($item['type'] == 'route') { |
|
49 | 49 | $sub->route($item['route'], $item['name'], [], 0, ['active' => $item['active-state']]) |
50 | 50 | ->hideWhen($item['ability']); |
51 | 51 | } |
52 | - if($item['type'] == 'header') { |
|
52 | + if ($item['type'] == 'header') { |
|
53 | 53 | $sub->addHeader($item['name']); |
54 | 54 | } |
55 | - if($item['type'] == 'url') { |
|
55 | + if ($item['type'] == 'url') { |
|
56 | 56 | $sub->url($item['url'], $item['name'], 0, ['active' => $item['active-state']]) |
57 | - ->hideWhen($item['ability']);; |
|
57 | + ->hideWhen($item['ability']); ; |
|
58 | 58 | } |
59 | 59 | }); |
60 | 60 | }); |
61 | - } else { |
|
61 | + }else { |
|
62 | 62 | $definition->items->each(function($item) use ($menu) { |
63 | - if($item['type'] == 'route') { |
|
63 | + if ($item['type'] == 'route') { |
|
64 | 64 | $menu->route($item['route'], $item['name'], [], 0, ['active' => $item['active-state']]) |
65 | 65 | ->hideWhen($item['ability']); |
66 | 66 | } |
67 | - if($item['type'] == 'header') { |
|
67 | + if ($item['type'] == 'header') { |
|
68 | 68 | $menu->addHeader($item['name']); |
69 | 69 | } |
70 | - if($item['type'] == 'url') { |
|
70 | + if ($item['type'] == 'url') { |
|
71 | 71 | $menu->url($item['url'], $item['name'], 0, ['active' => $item['active-state']]) |
72 | - ->hideWhen($item['ability']);; |
|
72 | + ->hideWhen($item['ability']); ; |
|
73 | 73 | } |
74 | 74 | }); |
75 | 75 | } |
@@ -116,11 +116,11 @@ |
||
116 | 116 | */ |
117 | 117 | protected function registerMenus() |
118 | 118 | { |
119 | - if(!app('menu')->instance('sidebar')) { |
|
120 | - app('menu')->create('sidebar', function ($menu) { |
|
119 | + if (!app('menu')->instance('sidebar')) { |
|
120 | + app('menu')->create('sidebar', function($menu) { |
|
121 | 121 | $menu->enableOrdering(); |
122 | 122 | }); |
123 | - $this->app->singleton('menu.service', function(){ |
|
123 | + $this->app->singleton('menu.service', function() { |
|
124 | 124 | return new MenuService(); |
125 | 125 | }); |
126 | 126 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | 'hidden' => (bool) $field->hidden, |
24 | 24 | 'order' => $field->order, |
25 | 25 | 'default' => $field->default, |
26 | - 'required' => (string)$field->required, |
|
26 | + 'required' => (string) $field->required, |
|
27 | 27 | 'fieldType' => [ |
28 | 28 | 'name' => $type->name |
29 | 29 | ] |
@@ -124,7 +124,7 @@ |
||
124 | 124 | { |
125 | 125 | $fieldTypes = app('field.types'); |
126 | 126 | if (!isset($fieldTypes->types[$type])) { |
127 | - throw new NotAcceptableHttpException('El field type ' . $type . ' no esta registrado'); |
|
127 | + throw new NotAcceptableHttpException('El field type '.$type.' no esta registrado'); |
|
128 | 128 | } |
129 | 129 | $this->fieldType = app($fieldTypes->types[$type]); |
130 | 130 | } |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** Notifications Routes **/ |
4 | -Route::group(['middleware' => ['web', 'auth'], 'namespace' => 'Hechoenlaravel\JarvisFoundation\Http\Controllers'], function () { |
|
4 | +Route::group(['middleware' => ['web', 'auth'], 'namespace' => 'Hechoenlaravel\JarvisFoundation\Http\Controllers'], function() { |
|
5 | 5 | Route::get('notifications', ['as' => 'notifications.index', 'uses' => 'NotificationsController@index']); |
6 | 6 | Route::get('notifications/{id}/read', ['as' => 'notifications.read', 'uses' => 'NotificationsController@read']); |
7 | - Route::group(['prefix' => 'api'], function(){ |
|
8 | - Route::group(['prefix' => 'core'], function(){ |
|
7 | + Route::group(['prefix' => 'api'], function() { |
|
8 | + Route::group(['prefix' => 'core'], function() { |
|
9 | 9 | Route::resource('entity/{id}/fields', 'Core\FieldsController', ['only' => ['index', 'store', 'update', 'destroy']]); |
10 | 10 | Route::put('entity/{id}/order-fields', 'Core\FieldsController@reOrderFieldId'); |
11 | 11 | Route::get('field-type/{type}/form', 'Core\FieldsController@fieldTypeForm'); |