Answer the question
In order to leave comments, you need to log in
After migrating the Laravel application to the server, the application does not see the controllers. How to fix?
I'm trying to transfer a site from a local server to a server. In the process, I transferred files, created and imported a database dump, changed . ENV to connect the MySQL database, and also went to the root folder via SSH and executed the php artisan commands to clear the cache.
The site opens, but when you try to follow the link, you get an error:
Target class [App\Http\Controllers\infoController] does not exist . -
According to the error message, the InfoController.php controller is missing . But this file - the controller is actually present on the disk, and was not lost during the transfer from LAN.
How to solve the problem? Where to look?
Answer the question
In order to leave comments, you need to log in
Check that the file name matches the class name.
By mistake, the controller name is capitalized.
The problem is resolved. Cause the controller file name was lowercase InfoController.php , the class name is capitalized
class InfoController extends Controller
{
//
}
For any update of files on the server, you must use a certain set of commands (depending on the functionality).
In this case composer dump-autoload will solve the problem. (run even when you rename the file manually)
If the queues are running, then they are cached and you need to restart.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question