API Documentation
This API reference is now chunked into smaller feature files for cleaner navigation and faster AI-agent context loading.
API Docs Access Mode
The bundled docs UI endpoint is:
GET /api-docs
Use config/record.php to control visibility:
php
'api_docs' => [
'is_private' => env('SP_LARAVEL_API_DOCS_PRIVATE', false),
'access_token_key' => 'access_token',
'login_api' => '/v1/auth/login',
'email' => env('SP_LARAVEL_API_DOCS_EMAIL'),
],Behavior:
- If
api_docsconfig is missing, docs stay public by default. - If
is_private=false,/api-docsloads Scalar directly. - If
is_private=true,/api-docsshows a custom login form first. - If
is_private=true, Scalar uses secure web routes:POST /api-docs/auth/loginPOST /api-docs/auth/logoutGET /api-docs/openapi.json
- In private mode, API endpoints
/{api_prefix}/docs/openapi(.json)and/{api_prefix}/docs/llms.*are hidden with404to avoid schema leakage. login_apisupports relative route or absolute URL, so each client project can point docs login to its own auth endpoint.access_token_keycontrols token extraction key from login response payload.emailis optional and enforces a fixed docs login account.
Chunked Index
Direct Chunk Links
- Recommended Folder Structure
- Configuration and Middleware
- Validation
- Record Type Reference and Class-Based Examples
- Standard CRUD Operations
- Global RPC Functions
- Nested Relationship Writes and Bulk Operations
- Audit Management Endpoints
- Custom Function Endpoints
- Internal API Methods and Function Caching
- Realtime Events, OpenAPI Export, and Attribute Config
- Error Responses, Rate Limiting, and Security
- QueryHelpers Trait Documentation
- Model Context Protocol (MCP) Support
- Laravel AI SDK Integration