Hello, I’m a beginner with framework
Slim in version 3.8 when it recognizes my middleware and neither my class
They are with correct namespace
Slim Application Error
The application could not run because of the following error:
Message: Callable App \ Middleware \ Admin \ AuthMiddleware does not exist
File: C: \ Program Files (x86) \ EasyPHP-DevServer-14.1VC11 \ data \ localweb \ SIGA \ vendor \ slim \ slim \ Slim \ CallableResolver.php
You do need to post the code so people can help you.
Also, have you run
composer dump after creating your middleware?
Yes the modfleware was created first. Because it was from another project I copied the structure and the actions and then I downloaded the slim / slim depis I installed the views
again, am not sure how people can help without even see the code?
you need to fix your PSR4 section as the autoloader has no idea how to load your Classes http://d.zah.me/ckgIK8/9DzpzMiL
From what I see I do advice you that you learn more about Composer and how to use it to Autoload your Classes
as you can see its working after I added App to the autoloader
This composer is the same way of a previous project and it was running i will study more about composer
This from of autoloaf is correct
Or you charged more things
you code didnt have
"App":"app/" which tells composer to autoload the classes under then name space
Mostly the other project that you have done, has a different structure and all the code was under
Classes thats why it was working there.
I keep on giving error
A non-empty PSR-4 prefix must end with a namespace separator
Give me this project that is with you to see if it works