Multi-auth不工作5.4

时间:2017-08-07 08:20:54

标签: php authentication laravel-5

我有2个用户,即卖家和用户。两者的登录功能都很好但是当我登录卖家时没有退出按钮。 enter image description here

路线:

Route::post('/logout', 'Auth\PsController@logout');

psblade:

                 <ul class="nav navbar-nav navbar-right">
                    <!-- Authentication Links -->
                    @if (Auth::guest())
                        <li><a href="{{ route('ps.login') }}">Loginnn</a></li>
                        <li><a href="{{ route('ps.register') }}">Registerr</a></li>
                    @else
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                                {{ Auth::user()->name }} <span class="caret"></span>
                            </a>

                            <ul class="dropdown-menu" role="menu">
                                <li>
                                    <a href="{{ route('/logout') }}"
                                        onclick="event.preventDefault();
                                                 document.getElementById('logout-form').submit();">
                                        Logout
                                    </a>

                                    <form id="logout-form" action="{{ route('/logout') }}" method="POST" style="display: none;">
                                        {{ csrf_field() }}
                                    </form>
                                </li>
                            </ul>
                        </li>
                    @endif

0 个答案:

没有答案