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.
Laravel - Method [xxx] does not exist on [xxx]的更多相关文章
- MySQL错误:The user specified as a definer (XXX@XXX) does not exist
今天由于更换服务器,重新再本地备份了数据库,试运行程序报错,如下: MySQL错误:The user specified as a definer (XXX@XXX) does not exist 意 ...
- 使用Phalcon开发工具碰到的数据库问题"Table 'XXX' doesn't exist in database when dumping meta-data for XXX"
使用Phalcon开发工具,通过命令行生成程序框架 设置好config.php,在对数据库进行读取.保存数据的时候出现了问题“Table 'XXX' doesn't exist in database ...
- Android JS桥交互("Uncaught ReferenceError: xxx is not defined or xxx has no method")
网上android和js交互的代码有不少,也很容易搜到.最近在做的项目需要用到js桥,遇到了一些问题,记录下来,希望以后遇到能马上解决掉. 一开始我找的demo是从这个:http://blog.csd ...
- hibernate-Table 'XXX.XXX' doesn't exist
hibernate---Table 'XXX.XXX' doesn't exist 在设置自动生成数据表的策略中: <!-- 自动生成数据表的策略 --> <property nam ...
- MySQL错误:The user specified as a definer (XXX@XXX) does not exist (1449错误)最简解决方案
背景:从同事处通过备份和还原备份方法导入mysql数据库,导入成功后启动项目,发现出现以下错误:The user specified as a definer (XXX@XXX) does not e ...
- mysqldump: Got error: 1449: The user specified as a definer ('xxx'@'%') does not exist when using LOCK TABLES
开发同学说在测试环境使用mysqldump导出数据的时候遇到以下错误: # mysqldump -uroot -p --all-databases --routines --events --trig ...
- Linux下MySQL报Table 'xxx' doesn't exist错误解决方法,表名存在大小写区分
Linux服务器上在线装了个MySQL,但是部署web应用时一直报后台一直报错:Table 'xxx' doesn't exist. 本地测试一直都是正常的,同样的代码,同样的数据库,表是存在的,但是 ...
- href="javascript:xxx(this);"和onclick="javascript:xxx(this);"的区别
href="javascript:xxx(this);"和onclick="javascript:xxx(this);" 一直以为这两种写法是等同的,今天在项目 ...
- 项目 XXX 的 NuGet 程序包还原失败:找不到“xxx”版本的程序包“xxx”
项目 XXX 的 NuGet 程序包还原失败:找不到“xxx”版本的程序包“xxx” 编译新下载的代码出错 修改包管理器的源为 http://www.nuget.org/api/v2/ .重试后成功 ...
随机推荐
- 读《PMI 分析手册》
目录 读<PMI 分析手册> 官方 PMI 基本概况 官方制造业 PMI 官方非制造业 PMI 综合 PMI 产出指数 PMI 分析框架 PMI 与经济周期 官方 PMI 分析 参考研报 ...
- C运算符优先级和结合性
C中运算符优先级和结合性一览表: 在上表中能总结出一下规律: (1)结合方向只有三个是从右往左,其余都是从左往右: (2)逗号运算符的优先级最低: (3)对于优先级,有一个普遍规律:算术运算符 > ...
- .Net Core 基于 SnmpSharpNet 开发
SNMP简介(百度百科): SNMP 是专门设计用于在 IP 网络管理网络节点(服务器.工作站.路由器.交换机及HUBS等)的一种标准协议,它是一种应用层协议. SNMP 使网络管理员能够管理网络效能 ...
- DIY Images
正如你想到的,我们当然也想自己做一个属于自己的特别的图案吧. 其实很简单 25个中每一个led灯都是可以单独控制的,每一个灯都设10个级别,如果设置在0,则不发光,如果设置为9,则是最亮,1~8,则是 ...
- JavaSE 面试题: 方法的参数传递机制
JavaSE 面试题 方法的参数传递机制 import java.util.Arrays; public class Test { public static void main(String[] a ...
- SpringBoot扩展点之三:SpringBootServletInitializer扩展
SpringBootServletInitializer 熟悉了SpringApplication的原理之后,我们再来了解SpringBootServletInitializer的原理就比较容易了. ...
- [Atcoder ARC103D]Robot Arms
题目大意:平面上有$n$个点,要求你构造$m$条边(满足$m\leqslant40$),使得可以从原点到达给定的$n$个点(边必须平行于坐标轴).并要求输出每一条边的方向,每条边必须都使用,无解输出$ ...
- 【题解】逆序排列 [51nod1020]
[题解]逆序排列 [51nod1020] 传送门:逆序排列 \([51nod1020]\) [题目描述] 共 \(T\) 组测试点,每一组给出 \(2\) 个整数 \(n\) 和 \(k\),在 \( ...
- Azkaban 3.x 编译及部署
一.Azkaban 源码编译 1.1 下载并解压 Azkaban 在 3.0 版本之后就不提供对应的安装包,需要自己下载源码进行编译. 下载所需版本的源码,Azkaban 的源码托管在 GitHub ...
- C#拼音帮助类
如果使用此帮助类需要引用 using Microsoft.International.Converters.PinYinConverter; using NPinyin; 可以在NuGet里面下载 1 ...