From 0e0bda7b73d8bda19417d8dcab57a7aee9e72cfe Mon Sep 17 00:00:00 2001 From: Ranga Pathmasiri Date: Fri, 13 May 2016 06:13:31 +0530 Subject: [PATCH] update router --- app/Http/routes.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/Http/routes.php b/app/Http/routes.php index 2f2a2b7..a4fe7de 100755 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -20,11 +20,18 @@ return Response::json(Authorizer::issueAccessToken()); }); -Route::get('api', ['middleware' => 'oauth', function() { +Route::group(['prefix'=>'api','middleware' => 'oauth'], function() { // return the protected resource //echo “success authentication”; - $user_id=Authorizer::getResourceOwnerId(); // the token user_id - $user=\App\User::find($user_id);// get the user data from database + + Route::post('/user', function () { + + $user_id=Authorizer::getResourceOwnerId(); // the token user_id + $user=\App\User::find($user_id);// get the user data from database -return Response::json($user); -}]); \ No newline at end of file + return Response::json($user); + }); + + + +});