Search code examples
phplaravellaravel-5laravel-artisan

laravel(artisan) stuck on one error no matter the command


No matter what command I enter I get the error

"Base table or view not found: 1146 Table 'database.products' doesn't exist

I tried

php artisan migrate:reset
php artisan cache:clear
php artisan optimize
php artisan migrate

and other artisan commands and they all return the above mentioned error. Anyone has idea how to solve this


Solution

  • Check your Service Providers (particularly the boot method), make sure none of them are querying models or tables, unless those statements are happening in a closure. This includes any 3rd party providers.

    One of the common scenarios is a view()->share(...) that is querying the database.