I usually check the error message to see where the class is being looked at.
If, for example, I want to use an entity but the error message says App/Service/Entity was not found, I know I missed an import statement.
If that is not the case, I look at the directory structure and namespace, and then I dump-autoload at last.I usually do not have to resort to dump-autoload as I usually run it as soon I add/remove any namespaces.
Just a coder and a dad. I love my family and I love to code!!!! started coding at 11, so I have 25 years under my belt. Still love learning about it every day. Black lives matter!
That is a great point! I will update the post to reflect what my mindset was at the time. It was for those times you have done everything you can think of. Specifically when you update the composer.json psr-4 path name.
But I'll add your information to the post about making sure you have the import, totally spaced it!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I usually check the error message to see where the class is being looked at.
If, for example, I want to use an entity but the error message says App/Service/Entity was not found, I know I missed an import statement.
If that is not the case, I look at the directory structure and namespace, and then I dump-autoload at last.I usually do not have to resort to dump-autoload as I usually run it as soon I add/remove any namespaces.
That is a great point! I will update the post to reflect what my mindset was at the time. It was for those times you have done everything you can think of. Specifically when you update the composer.json psr-4 path name.
But I'll add your information to the post about making sure you have the import, totally spaced it!