1234567891011121314151617181920212223242526272829 |
- <?php
- use Illuminate\Http\Request;
- /*
- |--------------------------------------------------------------------------
- | API Routes
- |--------------------------------------------------------------------------
- |
- | Here is where you can register API routes for your application. These
- | routes are loaded by the RouteServiceProvider within a group which
- | is assigned the "api" middleware group. Enjoy building your API!
- |
- */
- $api = app('Dingo\Api\Routing\Router');
- $api->version('v1',[
- 'namespace'=>'App\Http\Controllers'
- ],function ($api){
- $api->get('index','IndexController@index');
- $api->get('course_img','IndexController@course_img');
- $api->get('code','IndexController@code');
- $api->group(['middleware'=>'jwttoken'],function ($api){
- $api->get('user',function (Request $request){
- return $request->user();
- });
- });
- });
|