git-agent for PHP (Laravel)

Conventional commits for Laravel and PHP projects

git-agent understands Laravel's MVC architecture, Eloquent ORM patterns, Artisan commands, and PHP namespace conventions, producing atomic conventional commits that align with Laravel best practices.

diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index 5c2a1b4..3d8f7e9 100644 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -1,14 +1,24 @@ <?php namespace AppHttpControllers; +use AppActionsCreateOrderAction; +use AppDataTransferObjectsOrderData; +use AppExceptionsInsufficientStockException; use AppModelsOrder; -use IlluminateHttpRequest; +use AppHttpRequestsStoreOrderRequest; class OrderController extends Controller { - public function store(Request $request) + public function __construct( + private readonly CreateOrderAction $createOrder, + ) {} + + public function store(StoreOrderRequest $request) { - $order = Order::create($request->all()); - return response()->json($order, 201); + $order = $this->createOrder->execute( + OrderData::fromRequest($request->validated()) + ); + return OrderResource::make($order)->response()->setStatusCode(201); } }
git-agent output
feat(orders): move order creation to dedicated action class with form request - extract order creation logic from controller into CreateOrderAction class - replace loose Request::all() with typed StoreOrderRequest and validation rules - introduce OrderData DTO for type-safe data transfer through the action - return OrderResource instead of raw JSON for consistent API responses The controller was handling both HTTP concerns and business logic; the action class encapsulates the creation workflow, making it testable independently of the HTTP layer and reusable across controllers and queue jobs.
  • Understands Laravel directory conventions (app/Models, app/Http/Controllers, app/Actions) for scope naming
  • Separates Eloquent model changes from migration and seeder changes
  • Recognises Artisan command and scheduled task definitions for accurate commit types
  • Handles Composer dependency updates (composer.json/composer.lock) as chore commits
brew install gitagenthq/brew/git-agent # inside your Laravel project git-agent init # detects app/ directory structure and suggests scopes
Does git-agent handle Laravel Sail and Docker development setups?
Yes. git-agent runs outside of Docker. It reads the staged git diff directly, so it works with any development environment including Laravel Sail, Valet, and Herd without additional configuration.
How does git-agent handle Laravel Nova and Filament admin panel changes?
Admin panel resource files and configuration are recognised as distinct concerns. They are committed separately from core application logic when the changes are independent.
Can git-agent work with PHP package libraries and non-Laravel frameworks?
Yes. Symfony, Slim, WordPress plugin development, and standalone PHP packages are all supported. git-agent focuses on the diff content rather than the framework.