zoukankan      html  css  js  c++  java
  • Laravel

    The controller is existing, and the method 'test' exist on 'AppHttpControllersAdminIndexController'. 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.

  • 相关阅读:
    November 07th, 2017 Week 45th Tuesday
    November 06th, 2017 Week 45th Monday
    November 05th, 2017 Week 45th Sunday
    November 04th, 2017 Week 44th Saturday
    November 03rd, 2017 Week 44th Friday
    Asp.net core 学习笔记 ( Area and Feature folder structure 文件结构 )
    图片方向 image orientation Exif
    Asp.net core 学习笔记 ( Router 路由 )
    Asp.net core 学习笔记 ( Configuration 配置 )
    qrcode render 二维码扫描读取
  • 原文地址:https://www.cnblogs.com/Super-Lee/p/11552641.html
Copyright © 2011-2022 走看看