Attendize/app/Http/Controllers/UserLogoutController.php

29 lines
481 B
PHP
Raw Normal View History

2016-02-29 15:59:36 +00:00
<?php
namespace App\Http\Controllers;
use Illuminate\Contracts\Auth\Guard;
2016-03-05 00:18:10 +00:00
use Illuminate\Routing\Controller;
2016-02-29 15:59:36 +00:00
2016-03-05 00:18:10 +00:00
class UserLogoutController extends Controller
{
2016-02-29 15:59:36 +00:00
protected $auth;
2016-03-05 00:18:10 +00:00
public function __construct(Guard $auth)
{
2016-02-29 15:59:36 +00:00
$this->auth = $auth;
}
/**
* Log a use out and redirect them
*
* @return mixed
*/
2016-03-05 00:18:10 +00:00
public function doLogout()
{
2016-02-29 15:59:36 +00:00
$this->auth->logout();
2016-03-05 00:18:10 +00:00
return redirect()->to('/?logged_out=yup');
2016-02-29 15:59:36 +00:00
}
2016-03-05 00:18:10 +00:00
}