I founnd this topic: Target class controller does not exist - Laravel 8, so in web.php I wrote:
use App\Http\Controllers\UserController;
//...
Route::get('/units', [UnitsController::class, 'getAllUnits']);
Route::get('/units2', 'App\Http\Controllers\UnitsController@getAllUnits');
But any time I have this same error:
Target class [UnitsController] does not exist.
second address works but it's so long and ugly. Why first address doesn;t work?