Create a folder named api in routes Copy routes\api.php into the api folder Rename api.php to v1.php

Route::prefix('api') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api.php')); into // example route will be /api/v1/users Route::prefix('api/v1') // add a version number ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api/v1.php')); // update the path to the api routes #did-you-know 🤔 Did you know? 📚 You can adjust your experience level in https://dev.to/settings to see more relevant content.
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