1.安装dingoapi之后,api路由访问报错:The version given was unknown or has no registered routes
解决方案:清理api缓存 php artisan api:cache
这个命令会生成一个新的缓存文件,建议不要使用,用第二种方法
这时:Unable to prepare route [api/helloworld] for serialization. Uses Closure.
这个意思是说,api清理缓存时不能有闭包形式的路由。
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function($api