Php Laravel 5.1 Auth::trust()不';Composer更新后无法工作

Php Laravel 5.1 Auth::trust()不';Composer更新后无法工作,php,laravel,authentication,composer-php,laravel-5.1,Php,Laravel,Authentication,Composer Php,Laravel 5.1,我在Laravel5.1中的项目,在Composer更新后无法登录 我跑之前一切都正常 composer update 我用的是标准内置的 AuthController.php中的函数Auth::trunt()总是返回false 我已经在Laravel5.1的一个新项目上测试了它,它也是同样的问题。 我做了密码重置,创建了新用户,没有任何效果 我得到这个错误: 这些凭据与我们的记录不匹配 这些是已更新的软件包: Updating dependencies (including require-

我在Laravel5.1中的项目,在Composer更新后无法登录

我跑之前一切都正常

composer update
我用的是标准内置的
AuthController.php
中的函数
Auth::trunt()
总是返回
false

我已经在Laravel5.1的一个新项目上测试了它,它也是同样的问题。 我做了密码重置,创建了新用户,没有任何效果

我得到这个错误:

这些凭据与我们的记录不匹配

这些是已更新的软件包:

Updating dependencies (including require-dev)
- Removing giggsey/libphonenumber-for-php (7.2.6)
- Installing giggsey/libphonenumber-for-php (7.2.8)
  Downloading: 100%

- Removing symfony/var-dumper (v2.7.10)
- Installing symfony/var-dumper (v2.7.11)
  Downloading: 100%

- Removing symfony/translation (v2.7.10)
- Installing symfony/translation (v2.7.11)
  Downloading: 100%

- Removing symfony/routing (v2.7.10)
- Installing symfony/routing (v2.7.11)
  Downloading: 100%

- Removing symfony/process (v2.7.10)
- Installing symfony/process (v2.7.11)
  Downloading: 100%

- Installing symfony/polyfill-mbstring (v1.1.1)
  Downloading: 100%

- Removing symfony/http-foundation (v2.7.10)
- Installing symfony/http-foundation (v2.7.11)
  Downloading: 100%

- Removing symfony/event-dispatcher (v2.8.3)
- Installing symfony/event-dispatcher (v2.8.4)
  Downloading: 100%

- Removing symfony/debug (v2.7.10)
- Installing symfony/debug (v2.7.11)
  Downloading: 100%

- Removing symfony/http-kernel (v2.7.10)
- Installing symfony/http-kernel (v2.7.11)
  Downloading: 100%

- Removing symfony/finder (v2.7.10)
- Installing symfony/finder (v2.7.11)
  Downloading: 100%

- Removing symfony/dom-crawler (v2.7.10)
- Installing symfony/dom-crawler (v2.7.11)
  Downloading: 100%

- Removing symfony/css-selector (v2.7.10)
- Installing symfony/css-selector (v2.7.11)
  Downloading: 100%

- Removing symfony/console (v2.7.10)
- Installing symfony/console (v2.7.11)
  Downloading: 100%

- Removing psy/psysh (v0.7.1)
- Installing psy/psysh (v0.7.2)
  Downloading: 100%

- Removing paragonie/random_compat (v1.2.1)
- Installing paragonie/random_compat (v1.4.1)
  Downloading: 100%

- Removing monolog/monolog (1.18.0)
- Installing monolog/monolog (1.18.1)
  Downloading: 100%

- Removing league/flysystem (1.0.18)
- Installing league/flysystem (1.0.20)
  Downloading: 100%

- Removing symfony/polyfill-util (v1.1.0)
- Installing symfony/polyfill-util (v1.1.1)
  Downloading: 100%

- Removing symfony/polyfill-php56 (v1.1.0)
- Installing symfony/polyfill-php56 (v1.1.1)
  Downloading: 100%

- Removing propaganistas/laravel-phone (2.6.1)
- Installing propaganistas/laravel-phone (2.7.0)
  Downloading: 100%

- Removing symfony/yaml (v3.0.3)
- Installing symfony/yaml (v3.0.4)
  Downloading: 100%

- Removing phpunit/phpunit (4.8.23)
- Installing phpunit/phpunit (4.8.24)
  Downloading: 100%

- Removing phpspec/phpspec (2.4.1)
- Installing phpspec/phpspec (2.5.0)
  Downloading: 100%
知道是哪个软件包导致了问题吗? 有什么解决方法或想法来解决这个问题吗

postLogin
功能(这是标准的,我没有做任何更改):

postRegister功能:

public function postRegister(Request $request)
{
    $validator = $this->validator($request->all());

    if ($validator->fails()) {
        $this->throwValidationException(
            $request, $validator
        );
    }

    Auth::login($this->create($request->all()));

    return redirect($this->redirectPath());
}

我发现了问题

我正在使用此软件包,但忘记在创建时为用户设置具有登录权限的角色

显然,我正在测试一个在播种过程中创建的用户(它附加了一个角色),但是当我尝试注册一个新用户时,问题开始了

$user->attachRole($regularUserRole)


Auth::trunt()
方法与
composer安装
和/或
composer更新
无关。。问题在于您的控制器代码。。您确定您的身份验证代码正确吗??提供控制器方法代码…什么是不工作?如果您已共享错误消息,您是否收到任何错误消息。@user3514160更新之前它正在工作。我发现错误:这些凭据与我们的记录不匹配扫描您是否显示代码??还请注意,
Auth::trunt()
方法使用
password\u verify()
方法检查密码是否散列。。你把密码以散列格式存储了吗?@user3514160不,我不能给你看密码,但正如我说的,这是标准的laravel登录过程,没有什么特别的。。。您可以尝试一下,克隆一个新的Laravel5.1项目,并进行composer更新
public function postRegister(Request $request)
{
    $validator = $this->validator($request->all());

    if ($validator->fails()) {
        $this->throwValidationException(
            $request, $validator
        );
    }

    Auth::login($this->create($request->all()));

    return redirect($this->redirectPath());
}
/**
 * Create a new user instance after a valid registration.
 *
 * @param  array  $data
 * @return User
 */
protected function create(array $data)
{
    $team = new Team(["name" => ""]);
    $regularUserRole = Role::where('slug','user')->first();
    $user = User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => bcrypt($data['password']),
    ]);
    if ($team->save() && $regularUserRole) {
        $user->team()->associate($team);
        $user->attachRole($regularUserRole);
        if ($user->save()) {
            $team->owner()->associate($user);
            $team->save();
            return $user;
        }
    }
    return false;
}