Reputation: 1524
I tried so many ways still not able to solve this issue.
View Code
<!DOCTYPE html>
<html>
<body>
{!! HTML::link('auth/logout', 'Logout') !!}
</body>
</html>
In \app\Http\Controllers\Auth\AuthController.php
public function getLogout()
{
$this->auth->logout(); // OR
// Auth::logout();
Session::flush();
return redirect('/auth/login');
}
I tried both ways still it show error
Undefined property: App\Http\Controllers\Auth\AuthController::$auth
Any idea how to solve this?
Upvotes: 1
Views: 1990
Reputation: 40909
Auth::logout() will work, just add
use Auth;
at the top of your controller file.
Upvotes: 2