SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value (SQL: insert into categories
(updated_at
, created_at
) values (2023-07-22 07:11:19, 2023-07-22 07:11:19))
#2679
Replies: 2 comments
-
Please ensure that Your column must be default in Null in MySQL database |
Beta Was this translation helpful? Give feedback.
-
I understood that your 'name' field of categories table assigned as 'nullable(false)' when migrated. |
Beta Was this translation helpful? Give feedback.
-
SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value (SQL: insert into
categories
(updated_at
,created_at
) values (2023-07-22 07:11:19, 2023-07-22 07:11:19))public function layout(): iterable
{
return [
Layout::table('categories', [
TD::make('name', 'Имя')
]),
Layout::modal('create', Layout::rows([
Input::make('name')->required()->title('Имя'),
Select::make('parent_id')->fromModel(category::class, 'name')->title('Под категория')
]))->title('Создать')->applyButton('Создать')
Beta Was this translation helpful? Give feedback.
All reactions