Php 路由:缓存仍不能使用已清除的api/路由

Php 路由:缓存仍不能使用已清除的api/路由,php,laravel,Php,Laravel,我正在运行一个API,但是php-artisan-route:cache仍然无法刷新,除非给出此错误消息 LogicException : Unable to prepare route [api/user] for serialization. Uses Closure. at /var/www/html/kmobile/vendor/laravel/framework/src/Illuminate/Routing/Route.php:917 913| */

我正在运行一个API,但是
php-artisan-route:cache
仍然无法刷新,除非给出此错误消息

 LogicException  : Unable to prepare route [api/user] for serialization. Uses Closure.

  at /var/www/html/kmobile/vendor/laravel/framework/src/Illuminate/Routing/Route.php:917
    913|      */
    914|     public function prepareForSerialization()
    915|     {
    916|         if ($this->action['uses'] instanceof Closure) {
  > 917|             throw new LogicException("Unable to prepare route [{$this->uri}] for serialization. Uses Closure.");
    918|         }
    919| 
    920|         $this->compileRoute();
    921| 
routes/api.php

<?php

use Illuminate\Http\Request;

请分享您的操作方法和路由e是没有闭包的路由,例如
route::get('test',function(){return true;})检查您所有的routes@A.ANoman已经共享了api.php。我已经用终端做了我的工作action@AlzafanChristian是的,检查了其中4个,没有一个有关闭功能。已尝试重新运行
route:cache
即使已删除,仍会引用回中间件调用it@iamlux20实际上,您只共享了api.php的第一行,这只是一条
use
语句。这不是很有帮助,我们需要查看该文件中的实际路由声明。