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

Owaiz_Yusufi's avatar

Repeater input searching for new table column

I have create a Repeater with multiple input fields but the problem is with the dynamic input fields for category pages as when ever I set the data and save the changes. I got the following error

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'category_id' in 'field list'
 `is_submenu` = 0,
  `is_active` = 1,
  `menu_schema` = [ { "link_type": "categories",
  "link_name": NULL,
  "alt_name": "s",
  "sub_menu_id": NULL,
  "category_id": "2" ================> Expected Result },
  { "link_type": "page",
  "link_name": NULL,
  "alt_name": NULL,
  "category_id": 2,      ================> Expected Result
  "sub_menu_id": NULL } ],
  `category_id` = 2, ================> Unexpected Result (This is the problem)
  `submenu_id` = ?,
  `menus`.`updated_at` = 2024 -04 -03 10: 25: 43

The Problem :

Problem is that on saving the changes it search for category_id column in the DB table but, also create the value inside the menu_scheme column.

Below is my code

Forms\Components\Select::make('category_id')
->relationship('category', 'name')
->native(false)
->label('Name (Category)')
->hidden(fn (Get $get) => $get('link_type') !== 'categories'),
0 likes
2 replies
Owaiz_Yusufi's avatar

Any reason why it is creating category_id when I try to update the menu?

Please or to participate in this conversation.