-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Closed
Description
- Laravel Version: 5,4
Description:
I'm working with the Laravel Passport.
In my code I have this:
Route::group(['namespace' => 'SomeNamespace'], function(){ //App\Http\Controllers\SomeNamespace
Route::get('', function(){
return 'something';
});
\Laravel\Passport\Passport::routes();
});
I've been getting the error:
[ReflectionException]
Class App\Http\Controllers\SomeNamespace\Laravel\Passport\Http\Controllers\AuthorizationController does not exist
Now I've found the problem, which lies in the Passport.php file
/**
* Get a Passport route registrar.
*
* @param array $options
* @return RouteRegistrar
*/
public static function routes($callback = null, array $options = [])
{
$callback = $callback ?: function ($router) {
$router->all();
};
$options = array_merge($options, [
'namespace' => '\Laravel\Passport\Http\Controllers', //Here
]);
Route::group($options, function ($router) use ($callback) {
$callback(new RouteRegistrar($router));
});
}
As you can see at //Here the namespace doesn't reset, like normal php would.
I understand that if it was Laravel\... instead of \Laravel\... it would make sense but this goes against php standards, wouldn't you agree?
I'll try find the problem in the Route files and create a pull request.
Metadata
Metadata
Assignees
Labels
No labels