How to fix ‘Target class does not exist’ in Laravel 8
I have applied all three of these fixes but I am still getting an error:
- Add the namespace back manually so you can use it as you did in Laravel 7.x and before
- Use the full namespace in your route files when using the string syntax
- Use the action syntax (recommended)
use App\Http\Controllers\EventController;
use App\Http\Controllers\FamilyController;
use App\Http\Controllers\HedgehogController;
use App\Http\Controllers\KeywordController;
use App\Http\Controllers\CommentController;
Route::get('/comments', [App\Http\Controllers\CommentController::class, 'index']);
Is there anything else I can do to fix this?