Skip to content

Commit

Permalink
better errors for array names
Browse files Browse the repository at this point in the history
  • Loading branch information
pxpm committed Aug 15, 2024
1 parent 65ccb2a commit 2fc6d18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/Library/CrudPanel/CrudField.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct($nameOrDefinitionArray)
}

if (is_array($name)) {
$name = implode(',', $name);
abort(500, 'Field name can\'t be an array. It should be a string. Error in field: '.json_encode($name));
}

$field = $this->crud()->firstFieldWhere('name', $name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function makeSureFieldHasName($field)
}

if (is_array($field['name'])) {
$field['name'] = implode(',', $field['name']);
abort(500, 'Field name can\'t be an array. It should be a string. Error in field: '.json_encode($field['name']));
}

$field['name'] = Str::replace(' ', '', $field['name']);
Expand Down

0 comments on commit 2fc6d18

Please sign in to comment.