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

后端 未结 2 356
青春惊慌失措
青春惊慌失措 2021-01-17 15:26

I\'m working on a CMS and I have a little problem with my migrations. I added a new migration file and I wanted to add that one. That didn\'t work so I ran this bit:

2条回答
  •  感情败类
    2021-01-17 16:25

    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.

提交回复
热议问题