Thứ Bảy, 30 tháng 1, 2021

Laravel 8 - Target class [Controller] does not exist

*** Mở file: app/Http/Providers/RouteServiceProvider.php
*** Thêm dòng code: protected $namespace = 'App\Http\Controllers';

<?php

namespace App\Providers;

use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;

class RouteServiceProvider extends ServiceProvider
{
    /**
     * The path to the "home" route for your application.
     *
     * This is used by Laravel authentication to redirect users after login.
     *
     * @var string
     */
    public const HOME = '/home';
    protected $namespace = 'App\Http\Controllers';

    /**
     * The controller namespace for the application.
...

Không có nhận xét nào:

Đăng nhận xét