-
Notifications
You must be signed in to change notification settings - Fork 288
Add support for tuple route generation #323
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
Add support for tuple route generation #323
Conversation
Per the issue comments, let's make this configurable, not simply based off the |
@jasonmccreary changed it to use |
Much cleaner. 👍 I'll get this merged once the tests pass and I make some tiny text tweaks. However, I may wait to tag until next week. You can use |
@@ -0,0 +1,5 @@ | |||
|
|||
|
|||
Route::resource('foo', App\Http\Controllers\FooController::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this is not (currently) allowed unless the RouteServiceProvider::$namespace
property is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could be a note about this in the config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the FQCN is only allowed with the tuple syntax. In order to use an FQCN for a single route (or resource) you must unset the namespace
property within your RouteServiceProvider
.
So, while I still like the config
, in order to fully achieve what you're after, there would also have to be some additional logic to check that property again. Which I'm on the fence about...
Since this is a configurable value, my guess is that this should be a deliberate action by the user. If they enable it without knowing what it does... |
Hmmm... I considered a PR to the framework to allow the FQCN even with this As such, I am comfortable with it as is, and to your point, guiding users to unset the property and/or upgrade to the latest version. However, we may wish to change the option name to |
Hm, if Laravel 8 will leave the value blank, the config value shouldn't just be |
Co-authored-by: spaceemotion <spaceemotion@users.noreply.github.com>
Co-authored-by: spaceemotion <spaceemotion@users.noreply.github.com>
I was unsure which approach to take, but I ended up with reading out the actual value from the UrlGenerator class itself, rather than trying to analyze the RouteServiceProvider. Seemed like the most stable solution to me.
Fixes #321