/laravel-api-tool-kit:curl-testfrom laravel-api-tool-kit
Tests an API endpoint via curl, parses the response, and cross-references results against the database to identify cache, resource, or transformation bugs. Reports findings with mismatch diagnosis.
Claude never picks this command on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /laravel-api-tool-kit:curl-test still runs it.
Use during investigation or feature verification to test an endpoint directly and cross-reference its response against the database.
Trigger phrases: "test this endpoint", "curl this", "test the API", "verify the response", /curl-test
Best used alongside /investigate — curl response + DB comparison is the fastest way to prove a cache, resource, or transformation bug.
Generate the correct command based on the HTTP method:
# GET
curl -s -X GET "http://localhost/api/v1/ENDPOINT" \
-H "Authorization: Bearer TOKEN" \
-H "Accept: application/json" | jq .
# POST
curl -s -X POST "http://localhost/api/v1/ENDPOINT" \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"key": "value"}' | jq .
# PUT / PATCH
curl -s -X PUT "http://localhost/api/v1/ENDPOINT/ID" \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"key": "value"}' | jq .
# DELETE
curl -s -X DELETE "http://localhost/api/v1/ENDPOINT/ID" \
-H "Authorization: Bearer TOKEN" \
-H "Accept: application/json"
Always use -s (silent) + | jq . for readable output. Add -v when you need to inspect response headers.
If the user doesn't have a token, provide the login command:
curl -s -X POST "http://localhost/api/auth/login" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "password"}' | jq .token
When the user shares the response, check:
| Status | Meaning | Next step |
|---|---|---|
| 200 / 201 | Success | Validate response structure |
| 401 | Unauthenticated | Check token / auth middleware |
| 403 | Forbidden | Check policy |
| 404 | Not found | Check route / model binding |
| 422 | Validation failed | Read errors field |
| 500 | Server error | Check storage/logs/laravel.log |
This is the most valuable step. Compare the API response against raw DB data:
-- Get the raw record
SELECT * FROM table_name WHERE id = 'RECORD_ID';
-- If values differ → cache issue, resource bug, or accessor/cast bug
Mismatch diagnosis:
| API shows | DB shows | Likely cause |
|---|---|---|
| Stale value | Correct value | Cache not invalidated |
| Transformed value | Raw value | Accessor or cast applied |
| Missing field | Field exists | Resource not including it / when() condition false |
| Wrong value | Same wrong value | Data written incorrectly — trace the write path |
Endpoint: GET /api/v1/cars/CAR_ID
Status: 200 OK ✓
Response: { "balance": 50 }
Database: balance = 100
⚠ Mismatch — API returns 50, DB has 100.
Likely cause: cached value not invalidated on last update.
Next: check Cache::get() for key 'car:CAR_ID:balance'
❌ Assuming the endpoint URL — check routes first (php artisan route:list | grep keyword)
❌ Skipping the DB comparison — response vs DB is the fastest bug locator
❌ Testing only the happy path — test unauthenticated, forbidden, invalid input too
❌ Hardcoding specific IDs in saved commands — use CAR_ID, USER_ID placeholders
Files this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
Generated from the plugin's indexed repository (ahmedesa/laravel-api-tool-kit) — no native marketplace selected
npx claudepluginhub p/ahmedesa-laravel-api-tool-kit9 commands in this plugin
/add-filterWorkflow: Add Filtering to an Existing ModelUse this when an existing model needs filtering, sorting, or search added to its list endpoint./code-reviewWorkflow: Code ReviewA defense-oriented multi-phase code review. Validates feature completeness against acceptance criteria, catches real bugs (not just style), and separates introduced issues from pre-existing debt./Other plugins' commands for the same job