Laravel 5 Migrate Base table or view not found: 1146

前端 未结 12 623
情话喂你
情话喂你 2020-12-11 01:06

I am in big problem. I am trying to rum php artisan migrate to generate table migration, but i am getting

[2016-03-08 05:49:01] local.ERR

12条回答
  •  难免孤独
    2020-12-11 02:01

    I ran it to a similar problem.

    Seems like I executed a Model query in the routes file. So it executes every time, even before running the actual migration.

    //Problematic code
    Route::view('users', 'users', [ 'users' => User::all() ]);
    

    So I changed it to

    Route::get('/users', function () {
        return view('users', ['users' => User::all()]);
    });
    

    And everything works fine. Make sure that no Model queries is excecuted on the execution path and then try migrating.

提交回复
热议问题