Ad

Laravel 5.2 Base Table Or View Not Found Error

i have just started working with laravel 5.2.. this is a simple migration file but when i run the php artisan migrate command i get the error shown on the screenshot. what should i do now?

migration file

<?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');
    }
}

enter image description here

Ad

Answer

You need to change Schema::table to Schema::create.

Ad
source: stackoverflow.com
Ad