I have to code some feature on a an existing laravel project. I added docker for local development.
I got some errors that I fixed but I can't fix this one. When I load the page I have this error:
Base table or view not found: 1146 Table 'laraveldb.static_pages' doesn't exist (SQL: select * from `static_pages`)
Very easy to fix, I thought, I just have to run the migration with artisan:
docker-compose exec app php artisan migrate
It gives me the same error.
Every artisan commands seem to throw this error. (serve, cache:clear, optimize, even -v)
I understand that the error is probably in the loading of artisan or something like that, but I search on the web for similar errors with every keyword I could think of, I found only one person with the same problem, and no answers.
I already reinstalled vendors, etc. it did not work.
Maybe it's linked to docker, maybe to the Laravel configs, maybe to my system?
I don't often post here, but I don't know where to look to continue to debug my issue.
Have you ever seen something similar?
Php version: 7.4-fpm Cache: file Laravel version: 9.4.1
Here the callstack:
[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laraveldb.static_pages' doesn't exist at /var/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:82)
[stacktrace]
#0 /var/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(82): PDO->prepare('select * from `...', Array)
#1 /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(368): Doctrine\\DBAL\\Driver\\PDOConnection->prepare('select * from `...')
#2 /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(705): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}('select * from `...', Array)
#3 /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(672): Illuminate\\Database\\Connection->runQueryCallback('select * from `...', Array, Object(Closure))
#4 /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(376): Illuminate\\Database\\Connection->run('select * from `...', Array, Object(Closure))
#5 /var/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2414): Illuminate\\Database\\Connection->select('select * from `...', Array, true)
#6 /var/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2402): Illuminate\\Database\\Query\\Builder->runSelect()
#7 /var/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2936): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#8 /var/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2403): Illuminate\\Database\\Query\\Builder->onceWithColumns(Array, Object(Closure))
#9 /var/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(625): Illuminate\\Database\\Query\\Builder->get(Array)
#10 /var/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(609): Illuminate\\Database\\Eloquent\\Builder->getModels(Array)
#11 /var/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(568): Illuminate\\Database\\Eloquent\\Builder->get(Array)
#12 /var/www/app/Providers/AppServiceProvider.php(30): Illuminate\\Database\\Eloquent\\Model::all()
#13 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\\Providers\\AppServiceProvider->boot()
#14 /var/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#15 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#16 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#17 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#18 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(924): Illuminate\\Container\\Container->call(Array)
#19 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(905): Illuminate\\Foundation\\Application->bootProvider(Object(App\\Providers\\AppServiceProvider))
#20 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}(Object(App\\Providers\\AppServiceProvider), 32)
#21 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(906): array_walk(Array, Object(Closure))
#22 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot()
#23 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap(Object(Illuminate\\Foundation\\Application))
#24 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#25 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#26 /var/www/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))