V
V
Vova1357982021-12-31 23:47:23
Laravel
Vova135798, 2021-12-31 23:47:23

How to fix Target class [...] does not exist error?

Why does it give me an error Target class [TestController] does not exist?
The TestController.php file is located in app\Http\Controllers\TestController.php

web.php

<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return '!!!';
});

Route::get('/products/{title}', function ($title) {
    return 'Страница продукта' . $title;
});

Route::get('/show', '[email protected]');


TestController.php

<?php

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question