niduranga/laravel-dev-guard
最新稳定版本:v2.1.0
Composer 安装命令:
composer require niduranga/laravel-dev-guard
包简介
AI-powered TDD test generator for Laravel Actions
README 文档
README
Laravel DevGuard is an AI-powered TDD companion designed specifically for the Laravel Action pattern. It automates the tedious task of writing unit and feature tests by analyzing your business logic and generating production-ready Pest or PHPUnit tests using Google's Gemini AI.
Stop being a "Balu" developer spending hours on boilerplate tests. Focus on the logic, and let DevGuard handle the coverage.
🚀 Features
- Auto-Framework Detection: Automatically detects whether your project uses Pest or PHPUnit.
- Context-Aware Generation: Analyzes your Action classes and intelligently mocks dependencies.
- One-Command Setup: Seamless installation and configuration.
- Gemini AI Powered: Uses high-speed, high-accuracy LLMs to understand your code flow.
- SOLID Compliant: Generates tests that follow clean architecture and best practices.
📦 Installation
You can install the package via composer:
composer require niduranga/laravel-dev-guard
After the package is installed, run the installation command to publish the configuration file:
php artisan devguard:install
⚙️ Configuration
- Get your free API Key from the Google AI Studio.
- Add the following key to your
.envfile:
GEMINI_API_KEY=your_actual_api_key_here # Optional: Defaults to gemini-2.5-flash for high performance you can change to other models GEMINI_MODEL=gemini-3-flash-preview
🛠️ Usage
Simply point DevGuard to any Action class in your project.
php artisan guard:test Actions/CreateUserAction
What happens next?
- Scanning: DevGuard reads your
CreateUserActionclass. - Analysis: It identifies DB interactions, events, and external API calls.
- Generation: AI generates a comprehensive test suite.
- Saving: The test file is automatically saved in
tests/Feature/ortests/Unit/.
✅ Testing
We take testing seriously. This package is fully tested with Pest.
composer test
🤝 Contributing
Contributions are welcome! If you have ideas for new features or improvements, feel free to open an issue or submit a pull request.
📄 License
The MIT License (MIT). Please see License File for more information.
Developed with ❤️ by Niduranga Jayarathna
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-17