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

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

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.
Codex GPT-5.4 stumbles on file paths while building Laravel CRM
I Built a Mini-CRM with Codex GPT-5.4: Lessons Learned

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

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

. 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/Feature directory. 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.
3 min read