小编Has*_*idi的帖子

Laravel Migration致命错误:调用未定义的方法Illuminate\Database\Schema\Blueprint :: integar()

我的代码:

use Illuminate\Database\Schema\Blueprint;

use Illuminate\Database\Migrations\Migration;

class CreateTasksTable extends Migration

{
    /**
     * Run the migrations.

     *
     * @return void
     */
    public function up()
    {
        Schema::create('tasks', function (Blueprint $table) {
            $table->increments('id');
             $table->integar('user_id')->index();
            $table->string('name');
            $table->string('food');
            $table->string('quantity');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('tasks');
    }
}
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-5.2

-1
推荐指数
1
解决办法
2万
查看次数

标签 统计

laravel ×1

laravel-5.2 ×1

php ×1