Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 1.43 KB

File metadata and controls

47 lines (33 loc) · 1.43 KB

API Documentation

The application uses Scribe to automatically generate comprehensive and interactive API documentation from your Laravel routes and controller docblocks.

Integration Details

  • Public Endpoint: /docs
  • Authenticated Access: The API currently supports WorkspaceApiKey authentication.
  • Auto-generation: Documentation is generated by introspecting controller methods, FormRequests, and Eloquent resources.

Configuration

The configuration is located at config/scribe.php. Key settings include:

  • type: Set to static for the default HTML output.
  • routes: Configured to include routes with the api prefix or specific namespaces.

Adding Documentation to Controllers

To document an endpoint, use standard PHP docblocks in your controller methods:

/**
 * @group Workspace Management
 * 
 * Get workspace details.
 * 
 * This endpoint returns the primary metadata for the authenticated workspace.
 * 
 * @authenticated
 * @apiResource App\Http\Resources\WorkspaceResource
 * @apiResourceModel App\Models\Workspace
 */
public function show(Request $request) { ... }

Generation Command

Whenever you change your API routes or docblocks, regenerate the documentation:

php artisan scribe:generate

Testing

The API responses are automatically sampled during generation. Ensure your DatabaseSeeder provides sufficient data for realistic examples.