Skip to content

Fix this error

SQLSTATE[42S22]: Column not found: 1054 Unknown column

Dasun Kalupahana 195 views

The error

Error

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

Why it happens

The query uses a column the table doesn't have. Usually a migration that adds it was not run on this database, the name has a typo, or Eloquent is adding created_at / updated_at to a table without them.

How to fix it

  1. Run pending migrations: php artisan migrate (check with migrate:status).
  2. Compare the column name in your code with the table.
  3. If the table has no timestamps, add public $timestamps = false; to the model.
php artisan migrate:status
php artisan migrate
Still stuck? Send us the full error and what you tried. We add the answers here.

Learn more on the blog

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.