Codex unusable for Laravel projects
Resolved 💬 4 comments Opened Aug 24, 2025 by larskoole Closed Nov 27, 2025
💡 Likely answer: A maintainer (bolinfest, collaborator)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.23.0
Which model were you using?
gpt-5 (any)
What platform is your computer?
Darwin 24.6.0 x86_64 i386
What steps can reproduce the bug?
// web.php
Route::put('/', function () { return 'works!'; });
// Default Pest v4 test
<?php
test('returns a successful response', function () {
$response = $this->put('/');
$response->assertStatus(200);
});
Then run php artisan test
What is the expected behavior?
Codex runs php artisan test.
Output should be the test passing.
What do you see instead?
The test ends up failing with a 419 error.
This indicates that the put it tried to do was missing a CSRF token.
But this shouldn't happen because the env key APP_ENV is testing which disables CSRF.
Its also talking about MacOS seatbelt, no clue what that means.
<img width="1679" height="428" alt="Image" src="https://github.com/user-attachments/assets/7a36fc5e-c72c-435a-b7b3-c8f4e05e1a4e" />
Additional information
It does work with Gemini CLI, Claude Code, and Junie.
It doesn't work with Codex CLI or Copilot in agent mode on PHPStorm.
My expectations are this just works out of the box but it cant even run my test suite.
4 Comments
@larskoole I just wrote up a lengthy response to a comparable issue here:
https://github.com/openai/codex/issues/2641#issuecomment-3218285379
Here are some additional docs about our sandboxing:
https://github.com/openai/codex?tab=readme-ov-file#platform-sandboxing-details
@bolinfest thanks for the response. I've run every possible command and config imaginable to try and make this work but I cant.
I've tried the following:
codex debug seatbelt --full-auto -- php artisan testcodex --dangerously-bypass-approvals-and-sandbox debug seatbelt -- php artisan test```
[sandbox_workspace_write]
network_access = true
[sandbox_danger_full_access]
network_access = true
``
codex --sandbox workspace-write debug seatbelt -- php artisan testThen ran these commands:
codex --sandbox danger-full-access debug seatbelt -- php artisan test`All these commands resulted either of 2 things:
I'm willing to try and get this working. Do you have anything else left for me to try?
Some tools run their code in a separate process or container with its own environment, so variables from your shell don’t carry over. In Laravel, the test environment loads from .env.testing or phpunit.xml, not from .env. If configuration is cached (bootstrap/cache/config.php), that cache must be cleared for changes to take effect.
Running
php artisan optimize:clear(clears all possible caches includingbootstrap/cache) doesn't have any effect on the issue.When codex runs
php artisan testit does make it sobootstrap/cachegets filled withpackages.phpandservices.php, but I fail to see how that would have an effect on the tests failing.