Overview
Publish the default configuration file using Artisan:php artisan vendor:publish --tag=geni-config
config/geni.php.
Options
Document Information (info)
'title' => null, // defaults to config('app.name')
'version' => '1.0.0',
'description' => 'REST API documentation generated by Geni.',
'terms_of_service' => 'https://example.com/terms',
'contact' => [
'name' => 'API Support',
'email' => 'support@example.com',
'url' => 'https://example.com/support',
],
'license' => [
'name' => 'MIT',
'url' => 'https://opensource.org/licenses/MIT',
],
Route Discovery (api_path & routes)
// Routes matching this URI prefix are discovered for documentation:
'api_path' => 'api',
// Optional custom domain where API routes are served:
'api_domain' => null,
// Optional custom closure returning an array of Route objects:
'routes' => null,
Database Migrations (migration_paths)
// Directories containing migration files for SchemaReader offline replay:
'migration_paths' => [
database_path('migrations'),
],
Schema Overrides (schema_overrides)
// Manual escape hatch mapping 'table.column' => 'type' when migrations use raw SQL:
'schema_overrides' => [
'users.balance' => 'number',
'orders.metadata' => 'object',
],
Security Schemes (security_scheme & middleware_security)
// Middleware patterns that mark endpoints as protected:
'middleware_security' => [
'auth',
'auth:*',
],
// Default OpenAPI security scheme for matched endpoints:
'security_scheme' => [
'type' => 'http',
'scheme' => 'bearer',
'bearerFormat' => 'JWT',
'description' => 'Bearer token authentication',
],
// Per-middleware custom security schemes:
'middleware_security_schemes' => [
'auth:sanctum' => [
'name' => 'sanctumAuth',
'scheme' => ['type' => 'http', 'scheme' => 'bearer', 'bearerFormat' => 'JWT'],
],
'auth:api-key' => [
'name' => 'apiKeyAuth',
'scheme' => ['type' => 'apiKey', 'in' => 'header', 'name' => 'X-API-Key'],
],
],
Documentation Routing & Environment Gates
// URLs where documentation UI and raw JSON specifications are served:
'docs_ui_path' => 'docs/api',
'docs_json_path' => 'docs/api.json',
// Docs routes return 404 outside the 'local' environment unless false:
'restrict_to_local' => true,
// Middleware applied to the docs UI routes:
'middleware' => [
// 'web',
],
Documentation Authentication (docs_auth)
'docs_auth' => [
// 'form' or 'basic'
'mode' => env('GENI_DOCS_AUTH_MODE', 'basic'),
'username' => env('GENI_DOCS_USERNAME'),
'password' => env('GENI_DOCS_PASSWORD'),
],
Multi-Version APIs (apis)
'apis' => [
'v1' => [
'title' => 'API v1',
'version' => '1.0.0',
'api_path' => 'api/v1',
],
'v2' => [
'title' => 'API v2',
'version' => '2.0.0',
'api_path' => 'api/v2',
],
],
Model Context Protocol (mcp)
'mcp' => [
'enabled' => true,
'route_path' => 'docs/api/mcp',
'tool_naming' => 'snake', // 'snake' or 'operation_id'
'include_tags' => [],
'exclude_tags' => [],
'exclude_methods' => ['HEAD', 'OPTIONS'],
'execution' => [
'base_url' => env('GENI_MCP_BASE_URL'),
'timeout' => 15,
'verify_ssl' => true,
'auth' => [
'default_bearer_token' => env('GENI_MCP_BEARER_TOKEN'),
'default_api_key' => env('GENI_MCP_API_KEY'),
'api_key_header' => 'X-API-Key',
],
],
],