分析错误{}php迁移
我在分析错误{}php迁移,php,laravel,Php,Laravel,我在第50行得到一个解析错误,这是我的schema create语句的右括号,但是我看不到任何缺少的语法,所以我感到困惑 代码: class CreateUsersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('users', function
第50行得到一个解析错误,这是我的schema create语句的右括号,但是我看不到任何缺少的语法,所以我感到困惑
代码:
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('user_id');
$table->string('f_name');
$table->string('l_name');
$table->string('gender');
$table->date('dob');
$table->string('company_name');
$table->string('email')->unique();
$table->string('password');
$table->increments('landline');
$table->increments('mobile');
$table->increments('activated');
$this->increments('social_login');
$table->timestamp('last_login');
$table->rememberToken();
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}
Schema::create(
您从未关闭过该(
)
您使用的增量方法不正确-Laravel将尝试为每个$table->increments(…)创建一个自动递增主键
语句。即使指定的字段也不建议使用自动递增字段,您应该检查可用的方法这一行$This->increments('social_login');应该是$table->increments('social_login');
Schema::create('users', function (Blueprint $table) {
$table->increments('user_id');
$table->string('f_name');
$table->string('l_name');
$table->string('gender');
$table->date('dob');
$table->string('company_name');
$table->string('email')->unique();
$table->string('password');
$table->increments('landline');
$table->increments('mobile');
$table->increments('activated');
$this->increments('social_login');
$table->timestamp('last_login');
$table->rememberToken();
});