SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘eshop.sessions’ doesn’t exist
SELECT * FROM sessions
WHERE id
= N7H5CpGFStKcjjHhlq9aOo05OE0eU2I9muBXC4Tc limit 1
- When i check my database i have no table named sessions (never had by the way)
- I deleted the foder Migrations, Seeders, Factories and started again but no results
- I did all these commandes with no results
php artisan config:cache
php artisan config:clear
and composer dump-autoload -o
php artisan migrate:fresh –seed
php artisan migrate
3
Answers
In Laravel 11 you need to have a session table migration for this you can use the artisan comand
After:
If you are using Laravel 11 and do not have sessions migration in your create_users_table migration file, you will have to manually add it.
This is currently the latest migration file for laravel 11.x and inside you can find Schema for missing table
You can replace the session driver in .env file.
Laravel 11 by default has SESSION_DRIVER=database
if you don’t want to use this, change it to another driver like
SESSION_DRIVER=file