Answer the question
In order to leave comments, you need to log in
Why does laravel say the class doesn't exist if it exists?
Hello, I am new to laravel, I just sat down to master this framework and immediately got an annoying error. Says that the TestController controller does not exist, although it certainly does.
web.php:
App/Http/Controllers/TestController.php:
Route::get('test/show', '[email protected]');
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
class TestController extends Controller
{
public function show()
{
return 'TestController';
}
}
Answer the question
In order to leave comments, you need to log in
Above correctly wrote composer dump-autoload
do it.
In order not to do this manually every time - create controllers and so on through artisan, then everything will be created
for the controller php artisan make:controller TestController
and connected to autoload by itself.
php artisan help make
look what he can create
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question