The application uses Scribe to automatically generate comprehensive and interactive API documentation from your Laravel routes and controller docblocks.
- Public Endpoint:
/docs - Authenticated Access: The API currently supports
WorkspaceApiKeyauthentication. - Auto-generation: Documentation is generated by introspecting controller methods, FormRequests, and Eloquent resources.
The configuration is located at config/scribe.php. Key settings include:
type: Set tostaticfor the default HTML output.routes: Configured to include routes with theapiprefix or specific namespaces.
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) { ... }Whenever you change your API routes or docblocks, regenerate the documentation:
php artisan scribe:generateThe API responses are automatically sampled during generation. Ensure your DatabaseSeeder provides sufficient data for realistic examples.