From eabe1af5182e9760864d8556440f2800f42fe6ae Mon Sep 17 00:00:00 2001 From: Funky Waddle Date: Sat, 14 Feb 2026 23:43:17 -0600 Subject: [PATCH] docs: update Route Groups example in README --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a437ac5..d4aee1a 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,12 @@ $router->group(['prefix' => '/api', 'middleware' => ['auth']])->group(function($ $group->get('/settings', 'SettingsHandler'); }); ``` +All group routes inherit whatever options you pass in (middleware, prefix, etc). + +While the above syntax works and is completely viable, I find the double group method syntax a bit confusing. + +So, here is another way you can do it (my personal preferred method) that is, in my opinion, cleaner, and more readable. -You can also save a route group to a variable for more flexible route definitions: ```php $api = $router->group(['prefix' => '/api']);