Wendell Adriel Profile picture
Software Architect at TrackStreet 💻 Technical Content Writer ✍️ Open Source Enthusiast 🔥
Dec 28, 2022 4 tweets 2 min read
Have you ever heard of API versioning?

This is very handy when you need to add an alternative logic for some endpoints but want to keep the current logic for some users.

There are many ways to achieve this. I'm going to show a simple one in this 🧵

#Laravel #PHP #PHPC

1/4 Image 1. Create a folder api inside routes

2. Create a file v1.php inside routes/api

3. Create a file v2.php inside routes/api

4. Configure your routes/api.php file like the image

2/4 Image