Codex GPT-5.4 stumbles on file paths while building Laravel CRM
Overview
Modern AI agents promise to automate the heavy lifting of backend development, but they still require a human at the wheel to navigate architectural nuances. This guide explores the practicalities of building a mini-CRM using
Prerequisites
To follow this workflow, you should have a solid grasp of PHP 8.2+, the Laravel framework, and basic Terminal operations. Familiarity with
Key Libraries & Tools
- Laravel: The underlying PHP framework providing routing, Eloquent ORM, and database migrations.
- Filament: A TALL stack-based admin panel builder used for the CRM's UI components.
- Codex GPT-5.4: The primary AI agent used for code generation and terminal operations.
- Claude Code: Used as a secondary reviewer to cross-check the logic produced by Codex.

Code Walkthrough
The build was sliced into eight distinct phases, starting with the core data layer. A common pattern in the generated code involved placing domain validation directly within static::saving method. This leans toward Domain-Driven Design (DDD) by keeping invariants close to the data.
// Example of AI-generated model validation
protected static function booted()
{
static::saving(function ($model) {
if (!in_array($model->port_type, ['inbound', 'outbound'])) {
throw new \Exception('Invalid port type');
}
});
}
During the "Invisible Phase" (Phase 4), the AI generated complex services and actions. While functional, the logic often required manual cleanup for app/ namespace rather than a structured app/Enums/ directory, necessitating manual refactoring to maintain clean architecture.
Syntax Notes
One notable pattern was the AI's reliance on php artisan make:*-help commands. Rather than relying solely on training data, the agent actively consulted the local CLI documentation to verify parameters before executing commands. This demonstrates a transition toward RAG-based tool usage rather than just probabilistic text completion.
Tips & Gotchas
- Path Confusion: Codex repeatedly generated tests in a redundant
tests/Feature/Featuredirectory. Always verify the output path of AI-generated files before committing. - Credential Security: The agent consistently hardcoded default passwords in seeders. Replace these with environment variables or secure hashing immediately.
- The Multi-Model Review: Using Claude Codeto reviewCodex GPT-5.4code caught 13 issues that the original agent missed, highlighting the value of model diversity in code audits.