简体   繁体   English

调用未定义的方法 Laravel\\Lumen\\Routing\\Router::prefix()

[英]Call to undefined method Laravel\Lumen\Routing\Router::prefix()

I have tried to debug this on my own to no avail and all related questions found have not helped.我试图自己调试它但无济于事,并且发现的所有相关问题都没有帮助。

I have a Lumen application I cloned from my online repo on GitLab that giving me this error:我有一个从 GitLab 上的在线存储库克隆的 Lumen 应用程序,它给了我这个错误:

In Facade.php line 239:在 Facade.php 第 239 行:

Call to undefined method Laravel\\Lumen\\Routing\\Router::prefix()调用未定义的方法 Laravel\\Lumen\\Routing\\Router::prefix()

Please how do I fix this?请问我该如何解决这个问题?

My Lumen web.php route file seems to be working fine as follows:我的 Lumen web.php路由文件似乎工作正常,如下所示:

$router->group(['prefix' => 'agent'], function () use ($router) {
    $router->post('register-worker', 'UserController@registerWorkerByAgent');
    $router->get('workers', 'UserController@getAgentWorkers');
});

but the PHP artisan command is still giving me an error.但是 PHP artisan 命令仍然给我一个错误。 (see image) (见图) 在此处输入图片说明

For those that may come across this in the future.对于那些将来可能会遇到这种情况的人。 I solved this by downgrading my php version to 7.2 from 7.4我通过将我的 php 版本从 7.4 降级到 7.2 解决了这个问题

As it turns out.事实证明。 Php 7.4 now returns null at the call of some illuminate functions. Php 7.4 现在在调用某些照明函数时返回 null。 This was taking care of by downgrading to 7.2.这是通过降级到 7.2 来解决的。 I encountered this problem with a Lumen framework so I anticipate others might have similar issues as well.我在 Lumen 框架中遇到了这个问题,所以我预计其他人也可能有类似的问题。

Thanks for all the assists.感谢所有的帮助。 Hope this helps someone.希望这可以帮助某人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM