Api: Laravel5.5 执行php artisan api:routes没有路由,但是浏览器访问路由OK

Created on 11 Sep 2017  ·  4Comments  ·  Source: dingo/api

我的Laravel版本是5.5

在api.php里面定义路由如下

<?php
$api = app('Dingo\Api\Routing\Router');

$api->version('v1', function ($api) {
    $api->group(['namespace' => 'App\Api\Controllers']  ,function ($api){
            $api->get('lessons' , 'LessonsController@index');
    });
});

Terminal 里执行

[root@iZuf632lmt0g68o3jraamiZ ShareLoverServer]# php artisan api:routes
Your application doesn't have any routes.

但是浏览器访问URL没问题
http://mysite/api/lessons

Most helpful comment

All 4 comments

jie jue le ma?

No

升级一下dingo的版本

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sukh-gill picture sukh-gill  ·  3Comments

Grummfy picture Grummfy  ·  4Comments

adrian-fjellberg picture adrian-fjellberg  ·  4Comments

dejan7 picture dejan7  ·  3Comments

jhayiwg picture jhayiwg  ·  3Comments