How To Implement Laravel API V1/V2 Versioning

preview_player
Показать описание
This is a shortened video of the long-form tutorial on Laravel Daily.

- - - - -
Support the channel by checking out my products:

- - - - -
Other places to follow:
Рекомендации по теме
Комментарии
Автор

Saw this at the right time. Planning out my next project and I hadn't thought about versioning the API. thank you for this video!

BryanSchmidtSchmidty
Автор

Hello sir what will be the best way to send language (locale) in API.. 1. params (?lang=en) 2. url (url/en/abc) or others?

valpuia
Автор

How about on routes have a folder api/ then place v1.php, v2.php etc inside… then require those files in the default routes/api.php

sibow
Автор

How can you post it on the exact time when I needed it the most ?

hammadzafar
Автор

Hi Povilas, hope you're doing well. What about api versioning in laravel 11?

umidkurbanov
Автор

why I should duplicate the code in the second version api, I was working on a graduation project with the same idea and I not duplicated the code I still call the first api functions in case I not have a plan for adding a new actions, but in case I have a new actions I use your approach.

mmramadan
Автор

I've learned about API versioning, thanks a lot! I have another question: how can versioning be managed in an application when the database schema might need to be updated as the version increases? How can this be done automatically based on the current version?

sachinayon
Автор

Thank you for this insight.
Here what I use for versioning.
// V1 Route for the app
() {
require __DIR__.'/v1/api.php';
});
What do you think? I add this inside api.php file. Should I move it to routeServiceProvider?

debjit
Автор

Using git branching is another way to handle versioning from higher order. Having less complexity, duplicate and logical problems

Poooya
Автор

Can you explain us how Laravel routing system how it work underhood!

lahoucineoldakdim
Автор

HI nice tutorial, can you show me if we have some diff logic in observer or sevice in several version, i can image when use controller, but i can imagine using model versioning.

eg
v1 just have basic crud
v2 with observer, scope and more

is awesome if laravel daily team make video about this
thanks

zulfikarditya