0
|
1 |
<?php namespace TestCAS\Http\Controllers; |
|
2 |
|
|
3 |
use Cas; |
|
4 |
|
|
5 |
class HomeController extends Controller { |
|
6 |
|
|
7 |
/* |
|
8 |
|-------------------------------------------------------------------------- |
|
9 |
| Home Controller |
|
10 |
|-------------------------------------------------------------------------- |
|
11 |
| |
|
12 |
| This controller renders your application's "dashboard" for users that |
|
13 |
| are authenticated. Of course, you are free to change or remove the |
|
14 |
| controller as you wish. It is just here to get your app started! |
|
15 |
| |
|
16 |
*/ |
|
17 |
|
|
18 |
/** |
|
19 |
* Create a new controller instance. |
|
20 |
* |
|
21 |
* @return void |
|
22 |
*/ |
|
23 |
public function __construct() |
|
24 |
{ |
|
25 |
$this->middleware('auth.cas'); |
|
26 |
} |
|
27 |
|
|
28 |
/** |
|
29 |
* Show the application dashboard to the user. |
|
30 |
* |
|
31 |
* @return Response |
|
32 |
*/ |
|
33 |
public function index() |
|
34 |
{ |
|
35 |
return view('home'); |
|
36 |
} |
|
37 |
|
|
38 |
/** |
|
39 |
* logout |
|
40 |
* |
|
41 |
* @return Response |
|
42 |
*/ |
|
43 |
public function logout() |
|
44 |
{ |
|
45 |
cas::logout(['service'=>url('/')]); |
|
46 |
return redirect()->route('index'); |
|
47 |
} |
|
48 |
|
|
49 |
} |