SQLSTATE[42S22]: Column not found Laravel Origin: Application & API Last updated 4 Nov 2026

Laravel: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status' in 'field list'

The SQL refers to a column that doesn't exist in the table — a missing migration, typo or wrong table.

Exact message you may see SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status' in 'field list'Unknown column in 'where clause' LaravelSQLSTATE[42S22]: Column not found: 1054 Unknown column in 'order clause'Illuminate\Database\QueryException SQLSTATE[42S22]Unknown column 'x' in 'field list'
Seen on: Laravel PHP MySQL

Meaning

Compare the model's attributes with the table schema (php artisan db:table posts in Laravel 11). Common cause: the migration wasn't run in this environment. Also check $fillable, accessors, and column names in where/orderBy. Schema changes need php artisan migrate.

Common causes

  • Migration not run on this environment
  • Typo in column name
  • Column renamed in code but not in DB
  • Wrong table ($table property)
  • Select/withCount alias assumptions

⚡ Quick fix

  1. php artisan migrate:status then php artisan migrate
  2. Verify with php artisan db:table TABLE
  3. Fix column names in the query

Detailed fix by platform

Laravel

  1. php artisan migrate:status && php artisan db:table posts

How to diagnose

  1. Column — Exists in table?
  2. Migration — Applied?
  3. Query — Spelled right?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

Base table or view already exists — Laravel: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists (Laravel)Base table or view al…Foreign key constraint is incorrectly formed — Laravel migration: SQLSTATE[HY000]: General error: 1005 Can't create table (errno: 150 "Foreign key constraint is incorrectly formed") (Laravel)Foreign key constrain…Laravel table not found — Laravel: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.sessions' doesn't exist (PHP)Laravel table not fou…One or more database tables are unavailable — WordPress: One or more database tables are unavailable. The database may need to be repaired. (WordPress)One or more database …PDOException: could not find driver — Laravel: Illuminate\Database\QueryException: could not find driver (SQL: select * from information_schema.tables) (Laravel)PDOException: could n…Specified key was too long; max key length is 1000 bytes — Laravel: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (Laravel)Specified key was too…SQLSTATE[23000]: Integrity constraint violation — Laravel: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'x@example.com' for key 'users_email_unique' (Laravel)SQLSTATE[23000]: Inte…SQLSTATE[HY000] [1045] Access denied for user — Laravel: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: YES) (Laravel)SQLSTATE[HY000] [1045…SQLSTATE[…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.