Skip to content

Commit

Permalink
[9.x] Adds Improved Route Groups section to release notes (laravel#…
Browse files Browse the repository at this point in the history
…7603)

* Adds `Improved Route Groups` section to release notes

* Update releases.md

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
nunomaduro and taylorotwell authored Jan 20, 2022
1 parent 260b5d1 commit 9236a63
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,20 @@ Route::get('/categories/{category}', function (Category $category) {
});
```

<a name="controller-route-groups"></a>
### Controller Route Groups

_Route group improvements were contributed by [Luke Downing](https://github.com/lukeraymonddowning)_.

You may now use the `controller` method to define the common controller for all of the routes within the group. Then, when defining the routes, you only need to provide the controller method that they invoke:

use App\Http\Controllers\OrderController;

Route::controller(OrderController::class)->group(function () {
Route::get('/orders/{id}', 'show');
Route::post('/orders', 'store');
});

<a name="enum-casting"></a>
### Enum Eloquent Attribute Casting

Expand Down

0 comments on commit 9236a63

Please sign in to comment.