Skip to content

Commit af2691f

Browse files
Update README.md
1 parent 004a066 commit af2691f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,15 @@ Now the routes are only accessible with a version in the URL (eg `/api/v2/produc
220220
```php
221221
Route::middleware(['api', ApiVersionControl::class])
222222
->prefix('api')
223-
->as('default.')
223+
->as('no_version.')
224224
->group(base_path('routes/api.php'));
225225

226226
Route::middleware(['api', ApiVersionControl::class])
227227
->prefix('api/{version}')
228228
->where(['version' => 'v\d{1,3}'])
229229
->group(base_path('routes/api.php'));
230230
```
231-
_You can see here that we prefix the route name with `default.` (for the routers without a version). You have to do that to avoid the error `Another route is already using that name` when caching the routers. Decide for yourself whether this is desirable for your application._
231+
_You can see here that we prefix the route name with `no_version.` (for the routers without a version). You have to do that to avoid the error `Another route is already using that name` when caching the routers. Decide for yourself whether this is desirable for your application._
232232

233233
3. Add `\ReindertVetter\ApiVersionControl\ApiVersionControlServiceProvider::class` to your providers in config/app.php
234234
4. Create a config file by running `php artisan vendor:publish --provider='ReindertVetter\ApiVersionControl\ApiVersionControlServiceProvider'`.

0 commit comments

Comments
 (0)