Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

asep's avatar

Error “SQLSTATE[HY000]: Column ‘name’ does not have a default value” when creating/updating data with Filament Repeater (Laravel BelongsToMany)

Hello fellow developers,

I am developing a cashier application using Laravel and FilamentPHP. I am encountering an “Internal Server Error” with the specific message SQLSTATE[HY000]: General error: 1364 Field ‘name’ doesn't have a default value when trying to create or update cashier data that has a relationship with the menu through Filament Repeater.

I have two main models, Cashier and Menu, which have a Many-to-Many relationship (BelongsToMany). To manage this relationship in the Filament admin panel, I use Forms\Components\Repeater::make(‘menus’)->relationship(‘menus’) within KasirResource.php. This repeater allows me to select menu_id and enter quantity for each menu associated with the cashier order.

  1. When Creating a New Cashier: Although the error SQLSTATE[HY000]: General error: 1364 Field ‘name’ doesn't have a default value appears, the cashier data (and its menu relationship) is saved to the database. This is somewhat confusing, as such errors typically fail the operation.

  2. When Updating an Existing Cashier: When I attempt to edit existing cashier data, the exact same error (SQLSTATE[HY000]: General error: 1364 Field ‘name’ doesn't have a default value) appears, and the update operation fails.

  3. Creating the kasir_menu pivot table:*I have created a migration for the kasir_menu pivot table containing kasir_id, menu_id, and quantity. I have also confirmed that this migration was successfully executed (when running php artisan migrate, I received the message Table ‘kasir_menu’ already exists, indicating the table already exists).

0 likes
2 replies

Please or to participate in this conversation.