web.php:
Route::get('admin/manager/logout','Admin\IndexController@logout');
ManagerController:
public function logout(Request $request)
{
Auth::guard('admin')->logout();
return redirect('/admin/manager/login');
}
index.blade.php:
<li>
<a href="/admin/manager/logout" onclick="if(!confirm('Confirm exit?')){ return false }">Log out</a>
</li>
错误:
(1/1)BadMethodCallException方法[logout]不存在。
答案 0 :(得分:0)
logout
中定义的ManagerController
方法,因此在路由中更改它:
Route::get('admin/manager/logout','Admin\ManagerController@logout');