Laravel - Method [xxx] does not exist on [xxx]

The controller is existing, and the method 'test' exist on 'App\Http\Controllers\Admin\IndexController'. But Laravel show me that there is no method on the controller, I don't know why. I have askd for help on the internet, but no one can help me. The error like pic1.

 

 Now I show you my project folder and the files.

 

 The namespace of the IndexController.php is right. And the method test is existed. But Laravel told me that Method does not exist... I don't know what happend!

Maybe you have the same trouble, now, I will give you a way to solve the problem. Then, let's go.

Look at this file.

 

 There is a backup file in my project. I had edited the controller file after created the backup file. So the content of the two files is different. Initially, there is no problem. but when i execute the command "composer update"... Oh, my god!

Now, look at the directory vendor/composer, and open the file autoload_clappmap.php and autoload_static.php. Search IndexController in the two files.

In autoload_classmap.php:

 

 In autoload_static.php:

 

 Look at the red box. The real file is not IndexController.php, but is the backup file. I have said, the two file is different. The method test does not on IndexController.bk.php. So Laravel show me the error.

We have known why the problem happend. Now, we should solve it.

1) Update the 'IndexController.bk.php' to 'IndexController.php' that in the autoload_classmap.php and autoload_static.php.

2) Or you can delete the backup file or move it to other directory, then do 1).

3) Or you can delete the backup file or move it to other directory. Then execute the command composer update. But it is slow...

 

REPORT:

Developing good programming habits can avoid many mistakes.

转载于:https://www.cnblogs.com/Super-Lee/p/11552641.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
"error:--resume checkpoint does not exist"表示在程序运行过程中出现了错误,提示指定的checkpoint(检查点)不存在。 checkpoint是一种保存程序运行状态的机制,在许多应用中可用于保存模型参数、中间结果等。当程序需要恢复之前的运行状态时,可以使用checkpoint来实现。然而,如果指定的checkpoint不存在,程序就无法正确地恢复之前的状态,会出现错误。 出现这个错误的原因可能有以下几种: 1. 指定的checkpoint路径不正确:可能是路径被拼写错误或者路径不存在。需要仔细检查输入的路径是否正确,并确认路径下是否存在指定的checkpoint文件。 2. checkpoint文件被删除或移动:如果在程序运行期间手动删除或移动了checkpoint文件,那么程序就无法找到指定的checkpoint。此时,可以尝试找回或重新生成checkpoint文件。 3. 程序中指定的checkpoint名称与实际的名称不一致:可能是程序中指定的checkpoint名称与实际生成的名称不符合。需要确保指定的checkpoint名称正确。 针对这个错误,可以采取以下一些解决措施: 1. 检查路径和文件名:仔细检查checkpoint路径和文件名是否正确,并确保路径下存在指定的checkpoint文件。 2. 恢复或重新生成checkpoint文件:如果checkpoint文件被删除或移动,可以尝试找回原有的checkpoint文件或重新生成checkpoint文件。 3. 确认指定的checkpoint名称是否正确:确保程序中指定的checkpoint名称与实际生成的名称一致。 总之,出现"error:--resume checkpoint does not exist"错误说明在程序运行过程中找不到指定的checkpoint文件。通过仔细检查路径、文件名和名称的正确性,并采取相应的恢复或重新生成措施,可以解决这个问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值