Q: Bad path to API controller in Laravel I have a Laravel structure like this:
app/
   Http/
       Controllers/
          Api/
          Auth/
              RegisterController

and  the API route:
 // AUTH
   Route::namespace('Api')->group(function () {
     Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
     Route::post('password/reset', 'Auth\ResetPasswordController@reset');
     Route::post('register', 'Auth\RegisterController@register');
});

But the  POST request to http://domain.xx/api/register  return an internal error:

Class App\Http\Controllers\Api\Auth\RegisterController does not exist
  in file...

I've tried pointing to '..\Auth\RegisterController@register' but I got same error:

Class ..\Auth\RegisterController does not exist in file

It should be simple to fix lol... but... can you help me?

A: Routes Group
Route::group(['prefix' => 'api', 'namespace' => 'App\Http\Controllers'], function()
{
    Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
     Route::post('password/reset', 'Auth\ResetPasswordController@reset');
     Route::post('register', 'Auth\RegisterController@register');
});


You can delete folder App\Http\Controllers\Api, you can use PREFIX on
  your group routes


A: I fixed it
 // AUTH
   Route::namespace('Auth')->group(function () {
   Route::post('password/email', 'ForgotPasswordController@sendResetLinkEmail');
   Route::post('password/reset', 'ResetPasswordController@reset');
   Route::post('register', 'RegisterController@register');

});
