2016-05-02 238 views
-1

我想遷移(更新)這一點,但我不斷收到此錯誤信息:Laravel遷移錯誤語法

[Symfony的\分量\調試\異常\ FatalErrorException]語法錯誤, 意外 '>' ,要求以 '<'

Schema::table('products', function (Blueprint $table)) { 
     $table->string('XXXX', 50)->change(); 
     $table->string('XXXX', 50)->change(); 
     $table->string('XXXX', 10)->change(); 
     $table->String('XXXX', 100)->change();; 
     $table->String('XXXX', 100)->change(); 
     $table->String('XXXX', 100)->change(); 
     $table->String('XXXX', 50)->change(); 
     $table->tinyInteger('XXXX')->unsigned()->change(); 
     $table->tinyInteger('XXXX')->unsigned()->change(); 
     $table->String('XXXX', 100)->change(); 
     $table->tinyInteger('XXXX')->unsigned()->change(); 
     $table->String('XXXX', 50)->change(); 
     $table->String('XXXX', 50)->change(); 
     $table->String('XXXX', 50)->change(); 
     $table->String('XXXX', 50)->change(); 
     $table->String('XXXX', 50)->change(); 
     $table->boolean('XXXX')->change(); 
     $table->boolean('XXXX')->change(); 
     $table->boolean('XXXX')->change(); 
     $table->boolean('XXXX')->change(); 
     $table->boolean('XXXX')->change(); 
     $table->boolean('XXXX')->change(); 
     $table->boolean('XXXX')->change(); 
     $table->boolean('XXXX')->change(); 
     $table->boolean('XXXX')->change(); 
     $table->text('XXXX')->change(); 
     $table->String('XXXX', 100)->change(); 
     $table->String('XXXX', 100)->change(); 
     $table->String('XXXX', 100)->change(); 
     $table->String('XXXX', 100)->change(); 
     $table->tinyInteger('XXXX')->unsigned()->change(); 
     $table->tinyInteger('XXXX')->unsigned()->change(); 
     $table->tinyInteger('XXXX')->unsigned()->change(); 
     $table->tinyInteger('XXXX')->unsigned()->change(); 
     $table->String('XXXX', 50)->change(); 
     $table->String('XXXX', 50)->change(); 
     $table->String('XXXX', 50)->change(); 
     $table->String('XXXX', 50)->change(); 
     $table->text('XXXX'); 
     $table->timestamps(); 
    }); 
} 
+0

什麼行號?你確定它在這個區塊嗎? – Josh

回答

1

您在5日線有;;和也String代替string

順便說一下,當您運行migrate命令時,您可以從其他文件(控制器,中間件,助手等)中獲取錯誤。

0

Laravel Migration Documentation,它表示使用$table->string('XXXX',50);創建VARCHAR等效列。

因此,您的語句錯誤$table->String('XXXX', 50)->change();。您應該將所有String更改爲string

PS:其實在聲明中$table->String('XXXX', 100)->change();;。你已經使用;;,但不要緊,將報告沒有錯誤。