Invisnik Laravel Ошибки входа в Steamauth - PullRequest
0 голосов
/ 06 мая 2020

Итак, я только что создал проект в laravel 7 и добавил к нему invisnik steamauth , я еще не добавил фактический пакет аутентификации, поэтому, возможно, поэтому у меня проблема, однако я не хочу потерять то, что сделал.

Я выполнил эту миграцию:

Schema::create('users', function (Blueprint $table) {
        $table->id("steamid");
        $table->string('username');
        $table->string('avatar');
        $table->string('rank');
        $table->rememberToken();
        $table->timestamps();
    });

Затем я отредактировал функцию создания в контроллере steamauth следующим образом:

return User::create([
        'username' => $info->personaname,
        'avatar' => $info->avatarfull,
        'steamid' => $info->steamID64,
        'rank' => 0
    ]);

Когда я go для входа в систему, Я получаю эту ошибку:

SQLSTATE[HY000]: General error: 1364 Field 'username' doesn't have a default value (SQL: insert into `users` (`updated_at`, `created_at`) values (2020-05-06 18:32:42, 2020-05-06 18:32:42))

РЕДАКТИРОВАТЬ: вот пользователь. php модель

    class User extends Authenticatable
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];
}

Спасибо.

...