2013-10-23 65 views
7

我已经编译了Laravel 4的新安装,并且在生成迁移并尝试通过artisan迁移它之后出现此错误:Laravel 4:PHP致命错误:调用未定义的方法Blueprint :: int()

PHP Fatal error: Call to undefined method Illuminate\Database\Schema\Blueprint::int() in /home/casey/Sites/caseyhoffmann.me/laravel4/app/database/migrations/2013_10_22_232234_create_users_table.php on line 22 {"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call to undefined method Illuminate\Database\Schema\Blueprint::int()","file":"/home/casey/Sites/caseyhoffmann.me/laravel4/app/database/migrations/2013_10_22_232234_create_users_table.php","line":22}}

我试过重新编译Laravel,但无济于事。

任何想法或建议吗?

回答

22

您的int()应该替换为迁移文件中的integer()。像这样:

$table->integer('user_id');

+0

谢谢!简单的错误。 – cshoffie

+6

糟糕的错误消息,对于常见的错误非常不清楚。 – Ifnot

+1

@AnaelFavre我完全同意。我认为这将随着时间的推移而改善,因为Laravel成熟了。 –

相关问题