@@ -17,7 +17,7 @@ |
||
| 17 | 17 | * If the entity is supposed to create a |
| 18 | 18 | * table in the Database, it will do |
| 19 | 19 | * It won't do anything otherwise |
| 20 | - * @param Events $event |
|
| 20 | + * @param EntityWasCreated $event |
|
| 21 | 21 | * @return void |
| 22 | 22 | */ |
| 23 | 23 | public function handle(EntityWasCreated $event) |
@@ -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(); |
@@ -28,7 +28,6 @@ |
||
| 28 | 28 | /** |
| 29 | 29 | * CreateEntryCommand constructor. |
| 30 | 30 | * @param $entity |
| 31 | - * @param array $data |
|
| 32 | 31 | */ |
| 33 | 32 | public function __construct($entity, $entry_id, array $input) |
| 34 | 33 | { |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * Handle the creation of the Field in the Database |
| 17 | 17 | * @param $command |
| 18 | - * @return static |
|
| 18 | + * @return FieldModel |
|
| 19 | 19 | */ |
| 20 | 20 | public function handle($command) |
| 21 | 21 | { |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | /** |
| 11 | 11 | * Once the field has been edited in the DB Record |
| 12 | 12 | * The column in the entity table will be edited. |
| 13 | - * @param FieldWasCreated $event |
|
| 13 | + * @param FieldWasEdited $event |
|
| 14 | 14 | */ |
| 15 | 15 | public function handle(FieldWasEdited $event) |
| 16 | 16 | { |
@@ -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 | } |
@@ -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)); |
@@ -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 | ], |