API versioning is the process of creating new versions of an API whenever some big changes is necessary that could break the existing version of the API and ruin all the sites, apps or systems connected to it. It has become very common in recent years, the main idea behind API versions is to never delete the old versions of our code, whenever we need to make big changes in our system, specifically when this changes could create problems with integrations (Softwares who are consuming our APIs).

Note that the difference between the endpoints is “v1” and “v2”, they are related to the version we are using.

) could keep using the first version (v1) while the new version integrations could just use version 2 (v2).

Create controllers for v1 version: php artisan make:controller Api/V1/MyController
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners