Version routes with a prefix and keep version-specific controllers or resources isolated: ```php use App\Http\Controllers\Api\V1\PostController; Route::prefix('v1')->middleware('throttle:api')->group(function () { Route::apiResource('posts', PostController::class); }); ``` For larger APIs, place controllers under `App\Http\Controllers\Api\V1` and use a corresponding `V1` resource representation when the response contract differs. Add `auth:sanctum` to protected groups. Keep route names and co...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Laravel Api?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-laravel-api-2ec018c4)
Version routes with a prefix and keep version-specific controllers or resources isolated:
```php
use App\Http\Controllers\Api\V1\PostController;
Route::prefix('v1')->middleware('throttle:api')->group(function () {
Route::apiResource('posts', PostController::class);
});
```
For larger APIs, place controllers under `App\Http\Controllers\Api\V1` and use a corresponding `V1` resource representation when the response contract differs. Add `auth:sanctum` to protected groups. Keep route names and contracts explicit, and introduce `v2` as a separate group rather than silently changing the `v1` response. Test each version's status codes and JSON shape. The prefix is the public compatibility boundary; it should not be mixed with static URLs or raw model serialization.