Does not recognize the UsersController

0

! [ReflectionException (-1) Class App \ Http \ Controllers \ Admin \ UsersController does not exist] 1

Does anyone know why the controller does not recognize me? I just created the admin folder, I added the "Admin /" as the documentation says but I'm getting this error:

Class App \ Http \ Controllers \ Admin \ UsersController does not exist

    
asked by MarianoV 10.11.2017 в 05:59
source

3 answers

0

I already solved it, the process was simple: 1 - Add the "\ Admin" to the Route     (Admin \ UsersController @process) 2 - Add the "\ Admin" to the namespace of the controller     (namespace App \ Http \ Controllers \ Admin;) 3 - Add "use App \ Http \ Controllers \ Controller;" inside the UserController

With that the problem is solved.

    
answered by 05.12.2017 / 05:21
source
0

For the next try to also put examples of what you have.

You have to add it to the classmap of the composer.json file

"autoload": {
        "classmap": [
            "database",
            "Admin",
        ],
        "psr-4": {
            "App\": "app/"
        }
    },

And now you can use them

    
answered by 10.11.2017 в 08:53
0

Did you update the Controller namespace? If you did not, maybe that's it. Try to put some code when you ask for help to know exactly what the problem is. Greetings

It would be to pass this namespace namespace app\Http\Controllers to namespace app\Http\Controllers\Admin

    
answered by 12.11.2017 в 23:09