F
Filament4mo ago
Andrew

Column Not Found SQL ERROR

Hello, i'm using Filament 3.3. I have 3 tables in database ("employees", "departments" and a pivot table "department_employee"). I have a belongsToMany relationship in "Employee" and in "Department" models. I also have a pivot table "department_employee" that joins two tables. When I fill out the form "create employee" and enter data into the database, i get the error message: Error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'departments' in 'field list' (Connection: mysql, SQL: insert into `employees` (`last_name`, `first_name`, `middle_name`, `email`, `IP`, `departments`, `updated_at`, `created_at`) values (Doe, John, Thomas, john@example.com, 192.168.1.26, 11, 2025-06-18 09:37:29, 2025-06-18 09:37:29))
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'departments' in 'field list' (Connection: mysql, SQL: insert into `employees` (`last_name`, `first_name`, `middle_name`, `email`, `IP`, `departments`, `updated_at`, `created_at`) values (Doe, John, Thomas, john@example.com, 192.168.1.26, 11, 2025-06-18 09:37:29, 2025-06-18 09:37:29))
2 Replies
Solution
Kyrch
Kyrch4mo ago
Andrew
AndrewOP4mo ago
Solved! Everything works. Thank you for your answer.

Did you find this page helpful?