Laravel table not found 🐘 PHP

Laravel: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.sessions' doesn't exist

Laravel queried a table that hasn’t been created — usually sessions, cache, jobs or a new model’s table.

Seen on: PHP

Meaning

Using SESSION_DRIVER=database, CACHE_STORE=database or QUEUE_CONNECTION=database requires their tables. Laravel 11 defaults to database drivers, so a fresh install without php artisan migrate fails immediately.

Common causes

  • Migrations not run on this environment
  • Database driver configured without its table
  • Wrong DB_DATABASE in .env

⚡ Quick fix

  1. php artisan migrate --force
  2. Or switch drivers to file/array in .env
  3. Verify DB_DATABASE points to the right database

Detailed fix by platform

PHP

  1. Laravel 10: php artisan session:table && php artisan migrate

How to diagnose

  1. Table — Which table is missing?
  2. Driver — Which driver needs it?

🧠 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.