Laravel: Base table or view not found: 1146 Table 'database.pages doesn't exist

微笑、不失礼 提交于 2019-12-01 15:42:27

Remove any lines requesting data from your model from these files to be sure artisan is not trying to load data from your non-existent table:

  • bootstrap/start.php
  • app/start/global.php
  • app/start/local.php
  • app/routes.php

Also be sure to un-register any service providers that utilize data from that table in their register or boot methods inside of app/config/app.php.


The issue is that these files not only get executed for browser (web) requests, but for all requests, including command-line artisan invocations (e.g. php artisan migrate). So if you try to use something before it is available in any of these files, you are going to have a Bad Time.

You can use this to dictate when your app is running from the console. I believe this issue only occurs when you run a command

if( !App::runningInConsole() ){
  //allow laravel-menu to run
}

This way you will prevent data load from your non-existent table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!