Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Add namespace check to Auth routes #143

Merged
merged 2 commits into from
Sep 9, 2020
Merged

Conversation

barryvdh
Copy link
Contributor

@barryvdh barryvdh commented Sep 9, 2020

When removing the Route default namespace (as is default in Laravel 8), the Auth routes will break. This is the case for new Laravel 8 apps, but also when you want to upgrade to match the new defaults.

I understand this package is now deprecated, but if this is the only change it might be worth considering to give users the time to upgrade/change/get comfortable to Jetstream and let it stabilize/grow a bit first.

This checks if the Class with namespace exists. If it doesn't, it adds the default namespace, to compensate for laravel/laravel@58a98ef#diff-b467cc786635bd6945b17726282f1c64

Fixes #138 #141 #142

@barryvdh
Copy link
Contributor Author

barryvdh commented Sep 9, 2020

It's easier to check without whitespace changes: https://github.com/laravel/ui/pull/143/files?w=1

@driesvints
Copy link
Member

@barryvdh great solution. Thanks 👍

@driesvints driesvints changed the title Add namespace check to Auth routes [2.x] Add namespace check to Auth routes Sep 9, 2020
@taylorotwell taylorotwell merged commit 2ccaa3b into laravel:2.x Sep 9, 2020
@barryvdh barryvdh deleted the patch-2 branch September 9, 2020 12:25
@dimnsk
Copy link

dimnsk commented Sep 15, 2020

I have not Auth\LoginController but I have the value in the field RouteServiceProvider.namespace = "App\Http\Controllers" so namespace is applied twice and error appeared:

Illuminate\Contracts\Container\BindingResolutionException
Target class [App\Http\Controllers\App\Http\Controllers\Auth\ForgotPasswordController] does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auth::routes() gives a namespace error on LoginController
4 participants