Skip to content

Commit 32badcf

Browse files
committed
fixed a bug with fields-file commands
1 parent 3c767d2 commit 32badcf

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/Commands/FieldsFileCreateCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ public static function getFields($input, $withoutPrimaryKey)
115115
}
116116

117117
foreach ($input->names as $key => $name) {
118+
if(!$withoutPrimaryKey && strtolower($name) == 'id') {
119+
continue;
120+
}
121+
118122
$properties = ['name' => $name];
119123

120124
if (isset($input->htmlTypes[$key])) {

src/Support/FieldTransformer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -770,24 +770,24 @@ protected function setValidationProperty(Field & $field, array $properties)
770770
}
771771

772772
/**
773-
* It set the options property for a giving field
773+
* Checks an array for the first value that starts with a giving pattern
774774
*
775-
* @param array $values
775+
* @param array $subjects
776776
* @param string $search
777777
*
778778
* @return bool
779779
*/
780-
protected function inArraySearch(array $values, $search)
780+
protected function inArraySearch(array $subjects, $search)
781781
{
782-
foreach ($values as $value) {
783-
if(str_is($search . '*', $value)){
782+
foreach ($subjects as $subject) {
783+
if(str_is($search . '*', $subject)){
784784
return true;
785785
}
786786
}
787787

788788
return false;
789789
}
790-
790+
791791
/**
792792
* It set the options property for a giving field
793793
*

0 commit comments

Comments
 (0)