Skip to main content

Versioning your API: from V1 to V2 and Beyond

Premium
5:00

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Thananjeyan G avatar

Hi Polvis,

I recently upgrade a premium member. I mostly wanted API things.

For Versioning API demo videos are built with old version of Laravel.

Now I am using Laravel 8 or 9.

I couldnt see showed methods MapapiRoutes and Change namespace etc. ?

How can i do that in Laravel 9?

Thanks Thananjeyan !

Povilas Korop avatar

The mapApiRoutes method was my own method, it doesn't come from Laravel. I don't remember that exact course, but currently in Laravel 9 take a look at Laravel RouteServiceProvider and make the changes you need in $this->routes() method: https://github.com/laravel/laravel/blob/9.x/app/Providers/RouteServiceProvider.php

👍 1
Sylvain P avatar

I suppose both version should have same database, and can't improve without broken

Homby Lin avatar

Hi, Povilas, Should mapApiV2Routes() in the example be base_path('routes/api_v2.php') for it to be correct? (At 3:50 in the video)