@@ -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 | /** |
@@ -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'); |
@@ -49,10 +49,10 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | protected function getTableName($command) |
| 51 | 51 | { |
| 52 | - if(!empty($command->table_name)) { |
|
| 52 | + if (!empty($command->table_name)) { |
|
| 53 | 53 | return $command->table_name; |
| 54 | 54 | } |
| 55 | - if(empty($command->prefix)) { |
|
| 55 | + if (empty($command->prefix)) { |
|
| 56 | 56 | return $command->slug; |
| 57 | 57 | } |
| 58 | 58 | return $command->prefix.'_'.$command->slug; |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | public function presentFront() |
| 123 | 123 | { |
| 124 | 124 | $options = unserialize($this->fieldOptions); |
| 125 | - foreach($options as $option) { |
|
| 126 | - if(array_key_exists('transform', $option)) { |
|
| 125 | + foreach ($options as $option) { |
|
| 126 | + if (array_key_exists('transform', $option)) { |
|
| 127 | 127 | return $this->transformText($option['transform']); |
| 128 | 128 | } |
| 129 | 129 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | protected function transformText($transformation) |
| 138 | 138 | { |
| 139 | - switch ($transformation){ |
|
| 139 | + switch ($transformation) { |
|
| 140 | 140 | case "1": |
| 141 | 141 | return mb_strtoupper($this->value); |
| 142 | 142 | case "2": |