- Definition & Principles
- Folder Structure
- Code Sample
- Protect your Endpoints
- Difference between Public & Private routes files
Definition & Principles
API Route files MUST be named according to their API's version, exposure and functionality. e.g.
Web Route files are pretty similar to API web files, but they can be named anything.
Web & API route
Routes are defined exactly like the way you defined them in Laravel.
Route::post('hello', [Controller::class, 'sayHello']);
Protected Route (API)
Route::get('users', [Controller::class, 'listAllUsers'])
Protect your Endpoints:
Checkout the Authorization Page.
Difference between Public & Private routes files
Apiato has 2 types of endpoint, Public (External) mainly for third parties clients, and Private (Internal) for your own Apps. This will help to generate separate documentations for each and keep your internal API private.