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]的更多相关文章

  1. MySQL错误:The user specified as a definer (XXX@XXX) does not exist

    今天由于更换服务器,重新再本地备份了数据库,试运行程序报错,如下: MySQL错误:The user specified as a definer (XXX@XXX) does not exist 意 ...

  2. 使用Phalcon开发工具碰到的数据库问题"Table 'XXX' doesn't exist in database when dumping meta-data for XXX"

    使用Phalcon开发工具,通过命令行生成程序框架 设置好config.php,在对数据库进行读取.保存数据的时候出现了问题“Table 'XXX' doesn't exist in database ...

  3. Android JS桥交互("Uncaught ReferenceError: xxx is not defined or xxx has no method")

    网上android和js交互的代码有不少,也很容易搜到.最近在做的项目需要用到js桥,遇到了一些问题,记录下来,希望以后遇到能马上解决掉. 一开始我找的demo是从这个:http://blog.csd ...

  4. hibernate-Table 'XXX.XXX' doesn't exist

    hibernate---Table 'XXX.XXX' doesn't exist 在设置自动生成数据表的策略中: <!-- 自动生成数据表的策略 --> <property nam ...

  5. 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 ...

  6. 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 ...

  7. Linux下MySQL报Table 'xxx' doesn't exist错误解决方法,表名存在大小写区分

    Linux服务器上在线装了个MySQL,但是部署web应用时一直报后台一直报错:Table 'xxx' doesn't exist. 本地测试一直都是正常的,同样的代码,同样的数据库,表是存在的,但是 ...

  8. href="javascript:xxx(this);"和onclick="javascript:xxx(this);"的区别

    href="javascript:xxx(this);"和onclick="javascript:xxx(this);" 一直以为这两种写法是等同的,今天在项目 ...

  9. 项目 XXX 的 NuGet 程序包还原失败:找不到“xxx”版本的程序包“xxx”

    项目 XXX 的 NuGet 程序包还原失败:找不到“xxx”版本的程序包“xxx” 编译新下载的代码出错 修改包管理器的源为 http://www.nuget.org/api/v2/ .重试后成功 ...

随机推荐

  1. ESA2GJK1DH1K基础篇: STM32+Wi-Fi(AT指令版)实现MQTT源码讲解

    前言 注: 本程序发送心跳包,发送温湿度,返回控制数据这三个发送是单独的,有可能凑到一起发. 由于本身程序就是复杂性的程序,所以这节程序没有使用中断发送,没有使用环形队列发送,为了避免多条消息可能凑到 ...

  2. C语言实现Linux之ls

    ls命令用来显示目标列表. 常用参数: -l    :以长格式显示目录下的内容列表.输出信息从左向右依次包括文件名,文件类型,权限模式,硬连接数,所有者.组.文件大小和文件的最后修改时间等: -a   ...

  3. 箭头函数的this指向

    es6的箭头函数中this指向是跟普通function中的this指向不同的,普通function的this指向取决于调用function的对象, 而箭头函数的this指向取决于声明它的对象,看下面这 ...

  4. 三天精通Vue--学前摘要

    Vue Vue是一个前端框架,中文学习教程https://cn.vuejs.org/v2/guide/components.html 学习的前提:一点的 HTML+CSS+js node.js是前端的 ...

  5. USB、UART、SPI等总线速率(转)

    1. USB总线 USB1.1: ——-低速模式(low speed):1.5Mbps ——-全速模式(full speed): 12Mbps USB2.0:向下兼容.增加了高速模式,最大速率480M ...

  6. CF461B Appleman and Tree

    CF461B Appleman and Tree 传送门 一道比较容易的树形DP. 考虑用\(dp[i][1]\)代表将\(i\)分配给\(i\)的子树内黑点的方案数,\(dp[i][0]\)代表将\ ...

  7. Leetcode 219. 存在重复元素 II

    说明: 首先,这是一道Easy题,我天!但是题意理解还是很多坑~ 题目描述: 给定一个整数数组和一个整数 k,判断数组中是否存在两个不同的索引 i 和 j,使得 nums [i] = nums [j] ...

  8. Linux下多网卡绑定bond0及模式

    Linux 多网卡绑定 网卡绑定mode共有七种(0~6) bond0.bond1.bond2.bond3.bond4.bond5.bond6 常用的有三种 mode=0:平衡负载模式,有自动备援,但 ...

  9. UI自动化实例:遍历点击带有滚动条的列表每一项

    需求:验证列表每条资讯里的用户数是否正确.该列表分页请求数据,每页10条,每次滚动到底部自动增量请求10条. 实现自动化必要性: 1 资讯每天不定时更新需经常性验证, 程序更新或者环境切换需验证所有资 ...

  10. python入门之函数的嵌套

    目录 函数的嵌套调用 函数的嵌套定义 函数的嵌套调用 在函数内调用函数 def index(): print('from index') def func(): index() print('from ...