while creating a route, when I wanted to use a group, I stopped seeing the controller. And I have no idea what is wrong since it is in this folder and it works normally when it calls it Route::apiResource. Does anyone know what I'm doing wrong?
Route Code:
Route::group(['prefix' => 'v1', 'namespace' => 'App\Http\Controllers\Api\v1'], function(){
Route::prefix('news')->group(function(){
Route::get('/data?getPosts', [NewsController::class, 'index']); - Not Works
Route::get('/data', [NewsController::class, 'index']); - Not Works
});
//Route::apiResource('news', NewsController::class); - Works
});
Error:
Target class [NewsController] does not exist.