web.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Application Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here is where you can register all of the routes for an application.
  8. | It is a breeze. Simply tell Lumen the URIs it should respond to
  9. | and give it the Closure to call when that URI is requested.
  10. |
  11. */
  12. $router->get('/', function () use ($router) {
  13. return $router->app->version();
  14. });
  15. $api = app('Dingo\Api\Routing\Router');
  16. $api->version('v1', function ($api) {
  17. $api->post('auth/login', 'App\Api\V1\Controllers\AuthController@login');
  18. //$api->middleware('jwt.refresh')->post('auth/refresh', 'App\Api\V1\Controllers\AuthController@refresh');
  19. $api->group(['prefix' => 'auth','namespace'=>'App\Api\V1\Controllers'], function($api)
  20. {
  21. $api->post('logout', 'AuthController@logout');
  22. $api->get('me', 'AuthController@me');
  23. });
  24. });
  25. $api->version('v2', function ($api) {
  26. $api->get('users/{id}', 'App\Api\V2\Controllers\UserController@show');
  27. });