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 Codex GPT-5.4 within the Laravel and Filament ecosystem. We examine how to phase a project for AI consumption and the inevitable logic gaps that arise during automated generation.
Prerequisites
To follow this workflow, you should have a solid grasp of PHP 8.2+, the Laravel framework, and basic Terminal operations. Familiarity with Filament for rapid admin panel generation is highly recommended, along with a basic understanding of Git for version control.
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 Eloquent models using the 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 PHP Enums. Codex frequently defaulted to placing Enums in the root 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 Code to review Codex GPT-5.4 code caught 13 issues that the original agent missed, highlighting the value of model diversity in code audits.
- Codex GPT-5.4
- 18%· products
- Filament
- 18%· products
- Claude Code
- 9%· products
- Eloquent
- 9%· products
- Git
- 9%· products
- Other topics
- 36%

I Built a Mini-CRM with Codex GPT-5.4: Lessons Learned
WatchAI Coding Daily // 12:49
This channel is not for vibe-coders. It's for professional devs who want to use AI as powerful assistant, while still keeping the control of their codebase. My name is Povilas Korop, and I'm passionate about coding with AI. So I started this THIRD YouTube channel, in addition to my other ones Laravel Daily and Filament Daily. You will see a lot of my experiments with AI: I will try new things and share my discoveries along the way.