【发布时间】:2014-12-11 14:34:58
【问题描述】:
我是 laravel 4 的新手,在我的第一个项目中,当我尝试迁移这个时,我收到了这个错误:
迁移表创建成功。 {"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"调用 不信任的方法 Illuminate\Database\Schema\Blueprint::increments()","file":"foo","line: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');
}
}
谁能帮我纠正错误?
【问题讨论】:
标签: php mysql laravel laravel-4 migration