Bạn có thể tham khảo bài dưới:
https://www.scratchcode.io/laravel-8-target-class-controller-does-not-exist
https://laravel.com/docs/8.x/releases#routing-namespace-updates
Đầu tiên Bạn cần tạo Controller băng command:
php artisan make:controller HomeController
![](https://nimtechnology.com/wp-content/uploads/2024/04/image-13.png?v=1712685343)
bạn cần add thêm function index() và trỏ đến file home.blade.php
![](https://nimtechnology.com/wp-content/uploads/2024/04/image-14.png?v=1712686011)
chúng ta sẽ trở lại folder route
![](https://nimtechnology.com/wp-content/uploads/2024/04/image-15.png?v=1712686163)
<?php use Illuminate\Support\Facades\Route; use App\Http\Controllers\HomeController; Route::get('/', [HomeController::class, 'index']);
giờ bạn truy cập vào web là hiện thị là ok
![](https://nimtechnology.com/wp-content/uploads/2024/04/image-16.png?v=1712686241)