Agent Skills
› NeverSight/learn-skills.dev
› php-saloon
php-saloon
GitHub用于构建、调试 PHP Saloon API 集成与 SDK,涵盖连接器、请求、认证、测试及插件工作流。
Trigger Scenarios
构建或重构 Saloon 连接器、请求或 SDK 客户端
添加认证、请求体、重试、中间件或分页功能
使用 MockClient 或 Laravel 助手测试 Saloon 集成
处理 Saloon v3 到 v4 的大版本升级
Install
npx skills add NeverSight/learn-skills.dev --skill php-saloon -g -y
SKILL.md
Frontmatter
{
"name": "php-saloon",
"source": "https:\/\/docs.saloon.dev\/",
"license": "MIT",
"version": "1.0.0",
"description": "Use this skill when building or debugging PHP API integrations and SDKs with Saloon, including connectors, requests, authentication, request bodies, testing, pagination, Laravel integration, and Saloon plugin workflows."
}
php-saloon
Use this skill when you need to:
- build or refactor Saloon connectors, requests, or SDK-style clients
- add authentication, request bodies, retries, middleware, DTOs, pools, or pagination
- test Saloon integrations with
MockClient, fixtures, or Laravel helpers - work with Saloon plugins such as Laravel, caching, rate limiting, pagination, XML Wrangler, or Lawman
- upgrade Saloon between major versions, especially
v3tov4
Start Here
- Read
references/getting-started.mdfor install and first-request setup. - Read
references/core-patterns.mdfor connectors, requests, auth, bodies, and sending flow. - Read
references/api-reference.mdfor the most-usedResponse, failure-handling, and debugging APIs. - Read
references/advanced-patterns.mdfor DTOs, middleware, OAuth2, pools, retries, solo requests, PSR hooks, and SDK patterns.
Key Patterns
- Model each API integration with a
Connectorand each endpoint with aRequest. - Put shared behavior like base URL, default headers, auth, retries, and middleware on the connector.
- For request bodies, add
HasBodyand the matching trait likeHasJsonBody,HasMultipartBody,HasXmlBody,HasFormBody,HasStringBody, orHasStreamBody. - Use
Responsehelpers likejson(),dto(),dtoOrFail(),status(),failed(),throw(),getPsrRequest(), andgetPsrResponse(). - Prefer Saloon's built-in testing tools over real API calls in tests.
Quick Examples
use Saloon\Http\Connector;
class ForgeConnector extends Connector
{
public function resolveBaseUrl(): string
{
return 'https://forge.laravel.com/api/v1';
}
}
use Saloon\Enums\Method;
use Saloon\Http\Request;
class GetServersRequest extends Request
{
protected Method $method = Method::GET;
public function resolveEndpoint(): string
{
return '/servers';
}
}
$response = $connector->send(new GetServersRequest);
$servers = $response->json();
Reference Files
references/getting-started.md: installation, first connector, first request, sending basicsreferences/core-patterns.md: connectors, requests, auth, request bodies, and sending flowreferences/api-reference.md: response helpers, response customization, failure handling, and debug APIsreferences/advanced-patterns.md: SDKs, DTOs, middleware, OAuth2, pools, retries, solo requests, PSR hooksreferences/testing-debugging.md:MockClient, fixtures, assertions, debug helpers, known testing pitfallsreferences/integrations-plugins.md: pagination, Laravel plugin, caching, rate limits, XML Wrangler, Lawman, plugin authoringreferences/upgrades.md: supported versions,v2tov3,v3tov4, and security-sensitive upgrade notes
Retrieval Notes
- Open
references/core-patterns.mdbefore writing new Saloon code from scratch. - Open
references/api-reference.mdwhen you need the exact response and error-handling helpers to call. - Open
references/testing-debugging.mdbefore changing fixtures, mocks, or request inspection. - Open
references/upgrades.mdbefore touching legacy Saloon code or serializer, endpoint, and fixture-path behavior.
Version History
- e0220ca Current 2026-07-05 22:10


