Uza*_*han -3 laravel laravel-5 laravel-validation
[Symfony\Component\Debug\Exception\FatalErrorException] 语法错误,意外的 '(',需要标识符 (T_STRING) 或变量 (T_VARIABLE) 或 '{' 或 '$'
这是我的代码
public function up()
{
Schema::create('profile', function (Blueprint $table) {
$table->('userid')->unsigned()->default(0);
$table->string('profile')->default('http://localhost/laravel/public/image/uzair.jpg');
$table->string('about',255);
$table->foreign('userid')->references('id')->on('users')->onDelete('cascade');
$table->timestamps();
});
}
Run Code Online (Sandbox Code Playgroud)
$table->('userid')
Run Code Online (Sandbox Code Playgroud)
这就是您收到语法错误的原因。应该是$table->integer('userid')。
| 归档时间: |
|
| 查看次数: |
387 次 |
| 最近记录: |