Php Laravel 5.2基表或视图未找到错误

Php Laravel 5.2基表或视图未找到错误,php,laravel,database-migration,laravel-artisan,laravel-5.2,Php,Laravel,Database Migration,Laravel Artisan,Laravel 5.2,我刚刚开始使用laravel 5.2。。这是一个简单的迁移文件,但当我运行phpartisan migrate命令时,屏幕截图上显示了错误。我现在该怎么办 迁移文件 <?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateProductCategoryTable extends Migration { /** *

我刚刚开始使用laravel 5.2。。这是一个简单的迁移文件,但当我运行phpartisan migrate命令时,屏幕截图上显示了错误。我现在该怎么办

迁移文件

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProductCategoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('product_category', function (Blueprint $table) {
            $table->increments('id');
            $table->string('product_category_name');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
            Schema::drop('product_category');
    }
}

您需要将
Schema::table
更改为
Schema::create

对于我来说,这是因为我通过循环覆盖Task::all()在Kernel.php中通过我自己的自定义任务对象动态注册计划任务。但我的“任务”数据库表尚未创建,导致错误。因此,我注释掉了Kernel.php代码,运行了phpartisan migrate命令,然后取消了Kernel.php代码的注释。 不确定,但最好在Kernel.php代码中执行try{dbCode;}catch{doNothing;}