Integrity constraint violation: 1048 Column 'name' cannot be null #1051
-
i am using laravel pro and define a column: but after saving i catch an error "Integrity constraint violation: 1048 Column 'name' cannot be null" and see that this column value is not set to "". I don't want to change by db columns because of lib bugs. |
Beta Was this translation helpful? Give feedback.
Answered by
karandatwani92
Jun 26, 2024
Replies: 1 comment 3 replies
-
Blank spaces are trimmed before saving, and no value turns to
$this->crud->addField([
'name' => 'name',
'label' => __('name'),
- 'type' => 'name',
+ 'type' => 'text',
- 'default' => '',
]); |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The empty string gets trimmed and becomes null. It's expected, not a bug.
You have two options: