3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

laravel8系でTarget class [XXXController] does not exist. error

Posted at

公式コピペ注意報発令中です。
どこもおかしくない、でもわからん原因は?

原因

web.phpの書き方が8系になって変わった。

参考:https://laravel.com/docs/8.x/releases

対処例

これまで

web.php
Route::get('/users', UserController@index);

これから

web.php

use App\Http\Controllers\UserController;

Route::get('/users', [UserController::class, 'index']);

以上。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?