Skip to content

Commit 1a41c07

Browse files
author
Jad Joubran
committed
routes protected with jwt auth - dingo/api #43
1 parent ec2291e commit 1a41c07

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/Http/routes.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515

1616
Route::get('/unsupported-browser', 'AngularController@unsupported');
1717

18-
Route::group(['prefix' => 'api/1/'], function () {
19-
20-
21-
22-
});
2318

2419
$api = app('Dingo\Api\Routing\Router');
2520

@@ -30,7 +25,14 @@
3025
*/
3126
$api->controller('authenticate', 'App\Http\Controllers\AuthenticateController');
3227

33-
$api->post('test/sample', 'App\Http\Controllers\WelcomeController@sample');
3428

3529
$api->get('test', 'App\Http\Controllers\WelcomeController@getSample');
3630
});
31+
32+
33+
//protected with JWT
34+
$api->version('v1', ['middleware' => 'api.auth'], function($api){
35+
36+
$api->post('test/sample', 'App\Http\Controllers\WelcomeController@sample');
37+
38+
});

0 commit comments

Comments
 (0)