Skip to content

Commit 01d1a24

Browse files
committed
Merge branch '8.x' into master
2 parents 5d37694 + 04201b9 commit 01d1a24

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

eloquent.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ Now, let's look at an example `Flight` model, which we will use to retrieve and
6868

6969
#### Table Names
7070

71-
Note that we did not tell Eloquent which table to use for our `Flight` model. By convention, the "snake case", plural name of the class will be used as the table name unless another name is explicitly specified. So, in this case, Eloquent will assume the `Flight` model stores records in the `flights` table. You may specify a custom table by defining a `table` property on your model:
71+
Note that we did not tell Eloquent which table to use for our `Flight` model. By convention, the "snake case", plural name of the class will be used as the table name unless another name is explicitly specified. So, in this case, Eloquent will assume the `Flight` model stores records in the `flights` table, while an `AirTrafficController` model would store records in an `air_traffic_controllers` table.
72+
73+
You can manually specify a table name by defining a `table` property on your model:
7274

7375
<?php
7476

upgrade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Next, the `failed.driver` configuration option within your `queue` configuration
263263

264264
**Likelihood Of Impact: Optional**
265265

266-
In previous releases of Laravel, the `RouteServiceProvider` class contained a `$namespace` property with a value of `App\Http\Controllers`. This value of this property was used to automatically prefix controller route declarations controller route URL generation such as when calling the `action` helper.
266+
In previous releases of Laravel, the `RouteServiceProvider` class contained a `$namespace` property with a value of `App\Http\Controllers`. This value of this property was used to automatically prefix controller route declarations and controller route URL generation such as when calling the `action` helper.
267267

268268
In Laravel 8, this property is set to `null` by default. This allows your controller route declarations to use the standard PHP callable syntax, which provides better support for jumping to the controller class in many IDEs:
269269

urls.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,23 @@ It is cumbersome to always pass the `locale` every time you call the `route` hel
171171
}
172172

173173
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.
185+
*
186+
* @var array
187+
*/
188+
protected $middlewarePriority = [
189+
// ...
190+
\App\Http\MiddlewareSetDefaultLocaleForUrls::class,
191+
\Illuminate\Routing\Middleware\SubstituteBindings::class,
192+
// ...
193+
];

0 commit comments

Comments
 (0)