0
アップグレードLaravel。は5.0 5.1へのログインの問題
旧コンストラクタ:
public function __construct(Guard $auth, Registrar $registrar)
{
$this->auth = $auth;
$this->registrar = $registrar;
$this->middleware('guest', ['except' => 'getLogout']);
}
新しいコンストラクタ:
public function __construct()
{
$this->middleware('guest', ['except' => 'getLogout']);
}
そして、ここでは、私が$this->auth->login($user)
を変更する必要がありますどのように$this->auth->login($user);
public function getConfirmation($confirmationCode = null)
{
if ($confirmationCode) {
$user = User::where('confirmation_code', '=', $confirmationCode)->first();
if ($user) {
$user->update([
'confirmed' => 1,
'confirmation_code' => null
]);
$this->auth->login($user);
return redirect()->action('[email protected]_page', $user->name);
}
}
return view('auth.confirm');
}
に動作しないのですか?
から
Auth
ファサードを追加する必要がない場合は、キャッシュ& '作曲ダンプautoload'をクリアしようとしていますか? – Webinionは認証::ログイン($ユーザ)は動作しません何 – HasilT
を試してみてください?それがスローする例外を与えてください。 –