@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Hechoenlaravel\JarvisFoundation\Http\Controllers\Core; |
| 4 | 4 | |
| 5 | 5 | use Illuminate\Http\Request; |
| 6 | -use Hechoenlaravel\JarvisFoundation\Http\Requests; |
|
| 7 | 6 | use Hechoenlaravel\JarvisFoundation\Http\Controllers\Controller; |
| 8 | 7 | use Joselfonseca\LaravelApiTools\Traits\ResponderTrait; |
| 9 | 8 | use Hechoenlaravel\JarvisFoundation\Traits\EntityManager; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $data = $request->all(); |
| 62 | 62 | $data['entity_id'] = $id; |
| 63 | 63 | $field = $this->generateField($data); |
| 64 | - return $this->response->item($field, new FieldTransformer(), [], function ($resource, $fractal) use ($data) { |
|
| 64 | + return $this->response->item($field, new FieldTransformer(), [], function($resource, $fractal) use ($data) { |
|
| 65 | 65 | $resource->setMetaValue('return_url', $data['returnUrl']); |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $data = $request->all(); |
| 90 | 90 | $data['id'] = $fields; |
| 91 | 91 | $field = $this->editField($data); |
| 92 | - return $this->response->item($field, new FieldTransformer(), [], function ($resource, $fractal) use ($data) { |
|
| 92 | + return $this->response->item($field, new FieldTransformer(), [], function($resource, $fractal) use ($data) { |
|
| 93 | 93 | $resource->setMetaValue('return_url', $data['returnUrl']); |
| 94 | 94 | }); |
| 95 | 95 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $fieldTypes = app('field.types'); |
| 129 | 129 | if (!isset($fieldTypes->types[$type])) { |
| 130 | - throw new \NotAcceptableHttpException('El field type ' . $type . ' no esta registrado'); |
|
| 130 | + throw new \NotAcceptableHttpException('El field type '.$type.' no esta registrado'); |
|
| 131 | 131 | } |
| 132 | 132 | $this->fieldType = app($fieldTypes->types[$type]); |
| 133 | 133 | } |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Hechoenlaravel\JarvisFoundation\Http\Controllers\Core; |
| 4 | 4 | |
| 5 | 5 | use Hechoenlaravel\JarvisFoundation\Flows\Transition; |
| 6 | -use Illuminate\Http\Request; |
|
| 7 | 6 | use Hechoenlaravel\JarvisFoundation\Flows\Flow; |
| 8 | 7 | use Hechoenlaravel\JarvisFoundation\Flows\Step; |
| 9 | 8 | use Hechoenlaravel\JarvisFoundation\Http\Requests; |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | public function handle(EntityWasCreated $event) |
| 24 | 24 | { |
| 25 | 25 | if ((bool) $event->entity->create_table) { |
| 26 | - Schema::create($event->entity->table_name, function ($table) { |
|
| 26 | + Schema::create($event->entity->table_name, function($table) { |
|
| 27 | 27 | $table->increments('id'); |
| 28 | 28 | $table->timestamps(); |
| 29 | 29 | $table->softDeletes(); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | protected function setRulesForField($field) |
| 50 | 50 | { |
| 51 | 51 | $this->rules[$field->slug] = []; |
| 52 | - if ((bool)$field->required === true) { |
|
| 52 | + if ((bool) $field->required === true) { |
|
| 53 | 53 | array_push($this->rules[$field->slug], 'required'); |
| 54 | 54 | } |
| 55 | 55 | // Import the validation rules from the fieldtype Class |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | { |
| 22 | 22 | $field = $event->field; |
| 23 | 23 | if ($field->create_field) { |
| 24 | - Schema::table($event->field->entity->getTableName(), function ($table) use ($field) { |
|
| 24 | + Schema::table($event->field->entity->getTableName(), function($table) use ($field) { |
|
| 25 | 25 | $table->{$field->getType()->getColumnType()}($field->slug)->nullable()->default($field->default); |
| 26 | 26 | }); |
| 27 | 27 | event(new FieldWasCreatedInDb($field)); |
@@ -17,12 +17,12 @@ |
||
| 17 | 17 | $field = $event->field; |
| 18 | 18 | $rename = $event->rename; |
| 19 | 19 | $oldSlug = $event->oldSlug; |
| 20 | - Schema::table($event->field->entity->getTableName(), function ($table) use ($field, $rename, $oldSlug) { |
|
| 20 | + Schema::table($event->field->entity->getTableName(), function($table) use ($field, $rename, $oldSlug) { |
|
| 21 | 21 | if ($rename) { |
| 22 | 22 | $table->renameColumn($oldSlug, $field->slug); |
| 23 | 23 | } |
| 24 | 24 | }); |
| 25 | - Schema::table($event->field->entity->getTableName(), function ($table) use ($field) { |
|
| 25 | + Schema::table($event->field->entity->getTableName(), function($table) use ($field) { |
|
| 26 | 26 | $table->{$field->getType()->getColumnType()}($field->slug)->nullable()->default($field->default)->change(); |
| 27 | 27 | }); |
| 28 | 28 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | { |
| 13 | 13 | $field = $event->field; |
| 14 | 14 | $entity = EntityModel::find($field['entity_id']); |
| 15 | - Schema::table($entity->getTableName(), function ($table) use ($field) { |
|
| 15 | + Schema::table($entity->getTableName(), function($table) use ($field) { |
|
| 16 | 16 | $table->dropColumn($field['slug']); |
| 17 | 17 | }); |
| 18 | 18 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | if (!is_null($command->order)) { |
| 19 | 19 | $this->updateCurrentFields($command); |
| 20 | - } else { |
|
| 20 | + }else { |
|
| 21 | 21 | $command = $this->setOrder($command); |
| 22 | 22 | } |
| 23 | 23 | return $next($command); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | ->where('order', '>=', $command->order) |
| 34 | 34 | ->orderBy('order', 'ASC') |
| 35 | 35 | ->get() |
| 36 | - ->each(function ($field) { |
|
| 36 | + ->each(function($field) { |
|
| 37 | 37 | $field->order = $field->order + 1; |
| 38 | 38 | $field->save(); |
| 39 | 39 | }); |
@@ -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 | 'links' => [ |
| 28 | 28 | 'edit' => route('users.config.edit', ['id' => $field->id]) |
| 29 | 29 | ], |