当我运行php artisan migrate
,使表为我Laravel数据库中,我得到了以下错误:PHP的工匠迁移 - 意外“串”(T_STRING)
[Symfony\Component\Debug\Exception\FatalThrowableError]
Parse error: syntax error, unexpected 'string' (T_STRING), expecting variable (T_VARIABLE)
我认为,这个错误是因为它很没用没有告诉我在什么文件中,什么地方有什么错误(这使得很难理解正在发生的事情)。
由于在我的数据库中没有生成单个表,迁移似乎因第一次迁移而失败。
这是迁移(用户 - >用PHP人员化妆生成:AUTH):
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->string('avatar');
$table->rememberToken();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('users');
}
}
它只是与一个新行默认迁移。我无法找出它有什么问题。我已经尝试过composer dump-autoload
和composer clearcache
,但没有任何效果。
我希望有人知道一个解决方案。
编辑:它似乎发生在第一次迁移运行之前。有没有文件可能出错?
你可以阅读我的Laravel.log文件位置:https://pastebin.com/1PrDwady
这是什么? $表 - >头像( '密码'); – Scott