Laravel 4 - Migrations'Blueprint'是什么意思?

Big*_*ies 6 laravel laravel-4

我需要一些建议.

我的设置中有一些迁移文件.

在其中一些我看到以下代码不在其余的,我不知道它的用途

use Illuminate\Database\Schema\Blueprint;
Schema::create('brand', function(Blueprint $table)
Run Code Online (Sandbox Code Playgroud)

谁能告诉我蓝图线的用途?因为他们不在其他创建表迁移.

谢谢

Jan*_* P. 7

这是因为在闭包中,参数$table被标记为Blueprint对象.实际上每次a都Blueprint被传递到关闭时Schema::create.因此,您可以将参数限制为,Blueprint如果传递了其他类型的对象,则PHP会抛出致命错误,或者您可以将其留空,以便PHP不检查传递的对象.

只需查找use缺少-Statement 的文件.没有参数约束.