小编Uza*_*han的帖子

当我尝试迁移我的配置文件表时,它给了我错误。我正在使用 laravel 5.1

[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)

laravel laravel-5 laravel-validation

-3
推荐指数
1
解决办法
387
查看次数

标签 统计

laravel ×1

laravel-5 ×1

laravel-validation ×1