4,000 emails/month for free | Mailtrap sends real emails now!

The Practical Guide to Laravel + Nova on OpenAI Codex Web

Published on by

The Practical Guide to Laravel + Nova on OpenAI Codex Web image

Scripts, screenshots, and gotchas for secure private Composer auth in Codex environment containers.

OpenAI Codex is a popular CLI tool, but did you know that it also has a web tool?

Why this guide?

Private packages (like Laravel Nova) need credentials at install time. On Codex Web, secrets are only exposed during the Setup phase. If you try to install Nova later, auth won’t be available and Composer will 401. This guide shows a battle‑tested structure you can copy for your Laravel project.

✅ Works for any private Composer source (e.g., self‑hosted Satis/Private Packagist) — just swap the domain and credentials in the Composer config lines.

The Codex web UI isn’t clunky at all. Quite straightforward to use.

Here’s the practical, “what goes where” difference on Codex Web:

  • Setup script *→ runs when Codex builds a fresh environment container (and when it warms the cache). Use it to install toolchains, OS packages, language runtimes, and project dependencies; do one‑time project bootstrapping. Secrets are available only here.
  • Maintenance script → runs when Codex resumes an environment container from cache (e.g., on follow‑ups within ~12 hours) to bring your workspace up‑to‑date for the current commit/branch: pull latest deps, rebuild artifacts, run light migrations, etc. It’s optional but saves you from re‑doing heavy installs.

When does each run?

  • Fresh task or cache warm: setup runs, and the resulting container state is cached for up to ~12 hours.
  • Follow‑up task using that cache: maintenance runs to reconcile the container with the current code. Cache resets if you change setup/maintenance scripts, env vars, or secrets.
It runs perfectly!

Quick rules of thumb

  • Put heavy installs & one-time bootstraps in setup; put incremental updates in maintenance.
  • Any work needing secrets must happen in setup; they’re not available afterward.

Part 1 — Installing Laravel Nova (or any private Composer package)

1) Add secrets in Codex Web

Create two secrets in your environment:

  • NOVA_USERNAME
  • NOVA_LICENSE_KEY
This assumes you use a private Composer registry like Satis (which is what Laravel Nova uses)

If it isn’t already obvious, don’t commit these values to your repo. Codex will decrypt and expose them only while Setup runs.

2) Authenticate Composer & install deps in Setup script

Add this to your environment’s Setup script:

# [Rest of your setup scripts]
 
# Authenticate to Nova using secrets exposed to setup scripts
composer config "http-basic.nova.laravel.com" " $NOVA_USERNAME " " $NOVA_LICENSE_KEY "
 
# Install PHP deps (no-dev typical for CI/agent use; tweak as you need)
composer install --no-interaction --optimize-autoloader --no-dev

3) Keep Maintenance script light

Maintenance doesn’t have access to secret values; it’s for quick refreshes only:

pnpm run build
cp .env.example .env
sed -i 's/^DB_CONNECTION=.*/DB_CONNECTION=sqlite/' .env
php artisan key:generate
php artisan migrate --force
php artisan cache:clear
php artisan optimize

Part 2 — The end result: your Codex Web environment container (Laravel)

Below is the final shape we aim for — all Nova auth and Composer install happen in SetupMaintenance is a quick Laravel refresh.

This gives your coding agent runs a good slate to start with

Part 3 — Security & reliability tips

Automated tests are never a bad idea.
  • Never commit auth: keep Nova credentials (or any private registry auth) in Secrets only.
  • Use branch protection rules: Lock down your master/main branch and ensure safeguards are in place to prevent a rogue agent from pushing to it directly.
  • Create an AGENTS.md file: Set up a some guardrails and put sensible rules like “Create a unit tests for every component you introduce” or “Run the entire suite suite once you’re done”.
  • Use GitHub Action workflows: Run your linters and unit/integration/E2E tests in the CI on every push to vet reliability of AI-generated code.
  • Composer hygiene: --prefer-dist reduces source downloads; --no-interaction avoids prompts; consider COMPOSER_MEMORY_LIMIT=-1 if you hit OOM in large repos.
  • Pin versions: lock images/tools when reproducibility matters.
  • Don’t rely on .rc files for persistence: environment containers are ephemeral; rerun any required exports within Setup or use absolute paths.
  • Make Maintenance idempotent: it should be safe to run multiple times without changing state unexpectedly.

Part 4 — I’ll leave that bit to you

So far I’ve only been using Codex web to make small cosmetic changes on the fly. It hooks up really nicely with GitHub and if you have a GitHub Copilot subscription, you can even have it auto-review the code that Codex generates. Pretty fun tandem.

Codex can review code, but it’s even better

Enjoy!

JP Caparas photo

JP is an NZ-based Development Lead at Public Trust & Principal Developer at Zenoware. He loves shipping Laravel products and dabbles with agentic AI to improve experiences. His interests include DX, test-driven development, agentic coding and DevOps.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Tinkerwell

Enjoy coding and debugging in an editor designed for fast feedback and quick iterations. It's like a shell for your application – but with multi-line editing, code completion, and more.

Visit Tinkerwell
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
Laravel Gets a Claude Code Simplifier Plugin image

Laravel Gets a Claude Code Simplifier Plugin

Read article
Laravel Boost Update Adds Support for the New MCP Protocol image

Laravel Boost Update Adds Support for the New MCP Protocol

Read article
Pest Adds withHost for Browser Testing Subdomains in Laravel image

Pest Adds withHost for Browser Testing Subdomains in Laravel

Read article
Run Artisan Make Commands in Laravel VS Code Extension image

Run Artisan Make Commands in Laravel VS Code Extension

Read article
Livewire 4 Is Dropping Next Week, and wire:transition Makes Animations Effortless image

Livewire 4 Is Dropping Next Week, and wire:transition Makes Animations Effortless

Read article
Laravel 12.45.1, 12.45.2, and 12.46.0 Released image

Laravel 12.45.1, 12.45.2, and 12.46.0 Released

Read article