[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();
});
}
答案 0 :(得分:4)
$table->('userid')
这就是您遇到语法错误的原因。应该是$table->integer('userid')
。