|
2 | 2 |
|
3 | 3 | class HomeController extends BaseController { |
4 | 4 |
|
5 | | - /* |
6 | | - |-------------------------------------------------------------------------- |
7 | | - | Default Home Controller |
8 | | - |-------------------------------------------------------------------------- |
9 | | - | |
10 | | - | You may wish to use controllers instead of, or in addition to, Closure |
11 | | - | based routes. That's great! Here is an example controller method to |
12 | | - | get you started. To route to this controller, just add the route: |
13 | | - | |
14 | | - | Route::get('/', 'HomeController@showWelcome'); |
15 | | - | |
16 | | - */ |
| 5 | + /* |
| 6 | + |-------------------------------------------------------------------------- |
| 7 | + | Default Home Controller |
| 8 | + |-------------------------------------------------------------------------- |
| 9 | + | |
| 10 | + | You may wish to use controllers instead of, or in addition to, Closure |
| 11 | + | based routes. That's great! Here is an example controller method to |
| 12 | + | get you started. To route to this controller, just add the route: |
| 13 | + | |
| 14 | + | Route::get('/', 'HomeController@showWelcome'); |
| 15 | + | |
| 16 | + */ |
17 | 17 |
|
18 | | - public function showWelcome() |
19 | | - { |
20 | | - return View::make('hello'); |
21 | | - } |
| 18 | + public function verifyCredentials() |
| 19 | + { |
| 20 | + Log::info('Verifying credentials'); |
| 21 | + $user = DB::table('migrations')->where('migration', 'a migration')->first(); |
| 22 | + throw new Exception('No credentials passed!'); |
| 23 | + } |
| 24 | + |
| 25 | + |
| 26 | + public function authenticateUser() |
| 27 | + { |
| 28 | + Log::info('Authenticating the current user'); |
| 29 | + $this->verifyCredentials(); |
| 30 | + } |
| 31 | + |
| 32 | + public function showWelcome($id) |
| 33 | + { |
| 34 | + Log::info('Rendering a page thats about to error'); |
| 35 | + $this->authenticateUser(); |
| 36 | + return View::make('hello'); |
| 37 | + } |
22 | 38 |
|
23 | 39 | } |
0 commit comments