You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: urls.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,3 +171,23 @@ It is cumbersome to always pass the `locale` every time you call the `route` hel
171
171
}
172
172
173
173
Once the default value for the `locale` parameter has been set, you are no longer required to pass its value when generating URLs via the `route` helper.
174
+
175
+
#### URL Defaults & Middleware Priority
176
+
177
+
Setting URL default values can interfere with Laravel's handling of implicit model bindings. Therefore, you should [prioritize your middleware](https://laravel.com/docs/{{version}}/middleware#sorting-middleware) that set URL defaults to be executed before Laravel's own `SubstituteBindings` middleware. You can accomplish this by making sure your middleware occurs before the `SubstituteBindings` middleware within the `$middlewarePriority` property of your application's HTTP kernel.
178
+
179
+
The `$middlewarePriority` property is defined in the base `Illuminate\Foundation\Http\Kernel` class. You may copy its definition from that class and overwrite it in your application's HTTP kernel in order to modify it:
180
+
181
+
/**
182
+
* The priority-sorted list of middleware.
183
+
*
184
+
* This forces non-global middleware to always be in the given order.
0 commit comments