niduranga/laravel-dev-guard 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. Get your free API Key from the Google AI Studio.
  2. Add the following key to your .env file:
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?

  1. Scanning: DevGuard reads your CreateUserAction class.
  2. Analysis: It identifies DB interactions, events, and external API calls.
  3. Generation: AI generates a comprehensive test suite.
  4. Saving: The test file is automatically saved in tests/Feature/ or tests/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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固