I went to take Laravel 8 for a spin today, but it seems the Route facade cannot find controllers anymore.
The route /home
gives me this error:
Target class [HomeController] does not exist.
I get a similar error when I run: php artisan route:list
Illuminate\Contracts\Container\BindingResolutionException
Target class [Auth\LoginController] does not exist.
at C:\...\vendor\laravel\framework\src\Illuminate\Container\Container.php:811
811 throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
Thanks to lagbox, I ended up adding namespace('App\Http\Controllers')
to the web route in RouteServiceProvider boot method:
public function boot()
{
$this->configureRateLimiting();
$this->routes(function () {
Route::middleware('web')
->namespace('App\Http\Controllers')
->group(base_path('routes/web.php'));
That did the trick for me. Any better solutions would be most welcome.