Laravel 5.0注销重定向回到主页

时间:2017-09-02 16:00:06

标签: laravel

我的laravel版本是5.0.35,我的问题是,当我去注销时,它会重定向回主页。

经过几个小时的自我研究和谷歌搜索,我经历了许多决议,但都没有奏效。 例如:$ this->中间件('来宾',['除了' => ['退出',' getLogout']] );

访客中间件由于某种原因将请求重定向回主页,不知道为什么即使添加了注销方法也要豁免注销方法。 任何人都可以帮我解决这个问题。

我的AuthController现在

word = "DRIPPING"
letter = "P"
checkList = [" _ "] * len(word)
letterLocation=[3,4]

for (index, replacement) in zip(letterLocation, letter):
    checkList[index] = replacement

print(checkList) 

我已将项目升级到5.1.0以期解决问题,但仍无用。 有人请帮忙。

1 个答案:

答案 0 :(得分:1)

修改:

<?php 

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Registrar;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;


class AuthController extends Controller {

    /*
    |--------------------------------------------------------------------------
    | Registration & Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users, as well as the
    | authentication of existing users. By default, this controller uses
    | a simple trait to add these behaviors. Why don't you explore it?
    |
    */

    use AuthenticatesAndRegistersUsers;

    /**
     * Create a new authentication controller instance.
     *
     * @param  \Illuminate\Contracts\Auth\Guard  $auth
     * @param  \Illuminate\Contracts\Auth\Registrar  $registrar
     * @return void
     */
    public function __construct(Guard $auth, Registrar $registrar)
    {
        $this->auth = $auth;
        $this->registrar = $registrar;

        $this->middleware('guest', ['except' => ['logout', 'getLogout']]);
    }

    public function getLogout()
    {
        $this->auth->logout();
        return redirect('/mypage'); //**your link
    }
}