-
Notifications
You must be signed in to change notification settings - Fork 1
api documentation
Azizul Hakim edited this page Jan 3, 2026
·
3 revisions
Interactive API documentation with multiple interfaces.
Scalar API Documentation
- URL: http://localhost:8000/docs
- Features: Modern interface, interactive testing, dark/light themes
- URL: http://localhost:8000/docs/swagger
- Features: Classic interface, try-it-out functionality
Most endpoints require Bearer token authentication:
-
Login:
POST /api/v1/login - Copy token from response
- Authorize in documentation interface
- Test protected endpoints
Header Format:
Authorization: Bearer your-token-here
GET /api/healthPOST /api/v1/login
POST /api/v1/verify-otp
POST /api/v1/logoutGET /api/v1/user
GET /api/v1/user/profile
GET /api/v1/user/{id}
POST /api/v1/user
PATCH /api/v1/user/{id}
DELETE /api/v1/user/{id}
POST /api/v1/user/assign-role
POST /api/v1/user/change-password
POST /api/v1/user/export
POST /api/v1/user/profile/update
POST /api/v1/user/profile/change-password
POST /api/v1/user/profile/update-avatarGET /api/v1/role
GET /api/v1/role/{id}
POST /api/v1/role
PATCH /api/v1/role/{id}
DELETE /api/v1/role/{id}
POST /api/v1/role/assign-permissionGET /api/v1/permission
POST /api/v1/permission
DELETE /api/v1/permission/{id}
GET /api/v1/permission/user# Login
curl -X POST http://localhost:8000/api/v1/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "123456"}'
# Get users (with token)
curl -X GET http://localhost:8000/api/v1/user \
-H "Authorization: Bearer YOUR_TOKEN"API documentation is configured in config/scribe.php with custom generators:
'strategies' => [
'bodyParameters' => [
...Defaults::BODY_PARAMETERS_STRATEGIES,
\App\Http\Documentation\Strategies\OptionalFileUploadDetector::class,
],
'responses' => configureStrategy(
[
...Defaults::RESPONSES_STRATEGIES,
\App\Http\Documentation\Strategies\ParseAdditionalAnnotation::class,
]
),
],- Purpose: Adds custom metadata to API responses
-
Features: Merges
@additionalannotation data into response examples -
Usage: Add
@additional {"meta": {"custom_field": "value"}}to controller methods
- Purpose: Automatically generates standard error responses
- Features: Adds 401, 403, 422, and 500 error responses with proper schemas
- Usage: Automatically applied to all endpoints
- Purpose: Enhances OpenAPI specification generation
-
Features:
- Adds required headers (Accept, Content-Type)
- Handles optional file uploads (supports both JSON and multipart)
- Generates proper examples for different content types
- Usage: Automatically applied to all endpoints
- Purpose: Detects endpoints with optional file uploads
- Features: Identifies FormRequest classes with optional file fields
- Usage: Automatically detects and configures dual content-type support
-
Purpose: Extracts custom
@additionalannotations - Features: Parses JSON data from controller docblocks
-
Usage: Add
@additional {"key": "value"}to controller methods
php artisan scribe:generate/**
* Update user profile
*
* @additional {
* "meta": {
* "timestamp": "2024-01-01T00:00:00Z",
* "version": "1.0"
* },
* "custom_field": "value"
* }
*/
public function updateProfile(UpdateProfileRequest $request)
{
// Your implementation
}For detailed documentation, see the Features Guide.
Copyright 2026, @AHS12 All Right Reserved
- Home - Documentation Overview
- Quick Start - Installation and setup
- Project Structure - Directory organization
- Features Overview - Summary of capabilities
- Backup System - Database backups
- Extra Information - Additional tools
- Observability - Dashboard & Telemetry
- Health Checks - System status
- Running Tests - Testing guide
- API Documentation - API specs & UI
- Docker Guide - Container setup