调用未定义的方法Illuminate \\ Database \\ Schema \\ Blueprint :: incrementments()

ᴀʀᴍ*_*ᴍᴀɴ 5 php mysql migration laravel laravel-4

我是laravel 4的新手,在我尝试迁移的第一个项目中,我遇到了这个错误:

迁移表已成功创建.{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"调用undefiend方法Illuminate\Database\Schema\Blueprint :: incrementments()","file":" foo"的, "行:19"}}

这是我的迁移代码app\migration\2014_10_14_114343_add_cats_and_breeds_table.php:

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

class AddCatsAndBreedsTable extends Migration {

public function up()
{
    Schema::create('cats', function($table){
        $table->increments('id');
        $table->string('name');
        $table->date('date_of_birth')->nullable();
        $table->integer('breed_id')->nullable();
        $table->timestamps();
    });

    Schema::create('breeds', function($table){
        $table->incremetns('id');
        $table->string('name');
    });
}


public function down()
{
    Schema::drop('cats');
    Schema::drop('breeds');
}

}
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮我纠正错误吗?

Mar*_*łek 12

你有一个错字.

代替:

$table->incremetns('id');
Run Code Online (Sandbox Code Playgroud)

应该

$table->increments('id');
Run Code Online (Sandbox Code Playgroud)