I had the same problem and dump-autoload did not resolve it.
I realized that my class file was not declared in the vendor / composer / autoload_classmap.php file generated by Composer.
I cleared the contents of the cache folder. On Linux, this folder is: ~ / .composer / cache and on Windows 7: C: \ Users \\ AppData \ Local \ Composer \ files If bootstrap / compiled.php is present, it should also be deleted or run: php artisan clear-compiled .
After that, I deleted composer.lock and the vendor folder and ran: installer install. This placed my class file in the autoload_classmap.php file, however a ReflectionException was still thrown ...
As a last attempt, I copied and renamed another controller from an existing project, and this solved the problem.
source share