Download the PHP package digitalcorehub/laravel-api-docx without Composer
On this page you can find all versions of the php package digitalcorehub/laravel-api-docx. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digitalcorehub/laravel-api-docx
More information about digitalcorehub/laravel-api-docx
Files in digitalcorehub/laravel-api-docx
Package laravel-api-docx
Short Description AI-powered automatic API documentation generator for Laravel. Write code. Laravel API Docx writes the docs.
License MIT
Informations about the package laravel-api-docx
Laravel API Docx
🚀 Features
🤖 AI-Powered Intelligence
- Smart Documentation: Automatically generates meaningful descriptions using OpenAI GPT-4
- Advanced Analysis: Creates request/response examples, parameter documentation, and error responses
- Context-Aware: Understands Laravel patterns and generates relevant documentation
- Intelligent Caching: Avoids redundant AI API calls with smart caching
📝 Multiple Output Formats
- Markdown: Human-readable documentation perfect for GitHub/GitLab
- OpenAPI 3.0: Industry-standard specification for Swagger UI integration
- Postman Collection: Ready-to-import API testing collections
- ReDoc HTML: Beautiful, interactive documentation pages
🔍 Smart Route Analysis
- Automatic Discovery: Scans all API routes (starting with
api/) - Controller Analysis: Extracts controller and method information
- DocBlock Integration: Uses existing docblocks when available
- Middleware Detection: Analyzes route middleware and requirements
⚡ Developer Experience
- Zero Configuration: Works out of the box with sensible defaults
- Watch Mode: Automatically regenerates documentation on file changes
- Progress Indicators: Beautiful CLI output with emojis and progress bars
- Error Handling: Comprehensive error reporting and recovery
🎯 Laravel 12 Ready
- Modern PHP: Built for PHP 8.3+ with latest language features
- Laravel 12: Fully compatible with the latest Laravel version
- Performance: Optimized for speed and memory efficiency
- Security: Follows Laravel security best practices
📦 Installation
Via Composer
The package will automatically register itself with Laravel.
Publish Configuration
Environment Setup
Add your OpenAI API key to your .env file:
🎯 Usage
Quick Start
Generate documentation for all your API routes:
This creates:
- 📝
docs/api.md- Markdown documentation - 🔗
docs/api.json- OpenAPI 3.0 specification - 📮
docs/api.postman.json- Postman collection - 🌐
docs/api.html- Interactive ReDoc page
Advanced Usage
Format Selection
AI-Enhanced Documentation
Watch Mode
Custom Output Paths
🔧 How It Works
Process Flow
- 🔍 Route Discovery: Scans all registered routes and filters API routes
- 📊 Controller Analysis: Extracts controller, method, and middleware information
- 📚 DocBlock Processing: Checks for existing documentation in controller methods
- 🤖 AI Enhancement: Generates descriptions, examples, and parameters using OpenAI
- 💾 Smart Caching: Stores AI results to avoid redundant API calls
- 📝 Documentation Generation: Creates comprehensive docs in multiple formats
📋 Examples
Markdown Output
json GET /api/users?page=1&per_page=20&search=john json { "data": [ { "id": 1, "name": "John Doe", "email": "[email protected]", "created_at": "2024-01-01T00:00:00Z" } ], "meta": { "current_page": 1, "per_page": 20, "total": 100 } } json { "id": 1, "name": "John Doe", "email": "[email protected]", "profile": { "avatar": "https://example.com/avatar.jpg", "bio": "Software Developer" }, "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z" }
OpenAPI 3.0 Output
Postman Collection
⚙️ Configuration
AI Settings
Output Paths
Caching
Advanced Options
🧪 Testing
Run Tests
Code Quality
🚀 Performance
Optimization Tips
- Enable Caching: Always enable caching in production
- Use Watch Mode: For development, use
--watchto avoid manual regeneration - Selective Generation: Use
--formatto generate only needed formats - AI Optimization: Use
gpt-4o-minifor faster AI responses
Benchmarks
| Operation | Time | Memory |
|---|---|---|
| Route Collection | ~50ms | ~2MB |
| DocBlock Parsing | ~100ms | ~1MB |
| AI Generation (10 routes) | ~2s | ~5MB |
| Markdown Generation | ~20ms | ~1MB |
| OpenAPI Generation | ~30ms | ~2MB |
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
Pull Request Process
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📊 Roadmap
Upcoming Features
- [ ] GraphQL Support: Generate documentation for GraphQL APIs
- [ ] Custom Themes: Multiple ReDoc themes and customization options
- [ ] API Versioning: Support for multiple API versions
- [ ] Export Options: PDF, Word, and other format exports
- [ ] Team Collaboration: Multi-user documentation editing
- [ ] API Testing: Built-in API testing capabilities
- [ ] Webhook Integration: Automatic documentation updates via webhooks
Version History
- v1.0.0 - Initial release with basic features
- v1.1.0 - Added Postman and ReDoc support
- v1.2.0 - Advanced AI features and watch mode
- v1.3.0 - Performance optimizations and caching improvements
🛡️ Security
Security Policy
We take security seriously. If you discover a security vulnerability, please:
- DO NOT create a public GitHub issue
- Email us at [email protected]
- Include detailed information about the vulnerability
- We'll respond within 24 hours
Security Features
- Input Validation: All inputs are validated and sanitized
- API Key Protection: OpenAI API keys are never logged or exposed
- File Permissions: Generated files have appropriate permissions
- Dependency Scanning: Regular security audits of dependencies
📞 Support
Getting Help
- 📖 Documentation: Check this README and Wiki
- 🐛 Bug Reports: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Email: [email protected]
Community
- 🌟 Star us on GitHub if you find this project helpful
- 🐦 Follow us on Twitter @DigitalCoreHub
- 💼 LinkedIn: Digital Core Hub
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Laravel Team for the amazing framework
- OpenAI for the powerful AI capabilities
- ReDoc for the beautiful documentation UI
- Postman for the API testing platform
- All Contributors who help make this project better
All versions of laravel-api-docx with dependencies
illuminate/support Version ^12.0
illuminate/console Version ^12.0
illuminate/filesystem Version ^12.0
illuminate/routing Version ^12.0
guzzlehttp/guzzle Version ^7.0