The Wire · Showcase
LARAVEL AI CLOSES THE TOKEN LOOP, FRAMEWORK TIGHTENS TEST ASSERTIONS
By RepoJournal · Filed · About Laravel
Laravel AI now surfaces token usage from image generation across OpenAI and Gemini, while the framework ships a long-overdue testing counterpart and the installer fixes a Pest compatibility break.
The AI package is getting serious about observability [1]. OpenAI and Gemini's image endpoints were silently discarding token counts — fixed now, so you can actually track usage costs across your image generation pipeline. In the same breath, OpenRouter gained full image generation support [2], closing a gap where image requests threw LogicException. Together, these moves mean your image budgets are finally accountable.
Framework testing just became more balanced [3]. The new `assertSessionMissingInput()` completes the pair with `assertSessionHasInput`, letting you assert absence as cleanly as presence across session data — a small win that closes a year-old gap. The framework also corrected method return type annotations across Log Context, Attribute caching, Factory, and Translator [4][5][6][7], ensuring IDE autocomplete stops lying to you about fluent chains.
Installer hit a Pest compatibility wall [8]. Pest moved RefreshDatabase to namespace aliasing, which broke the installer's uncommenting logic and tanked test scaffolding. Fixed now, but worth knowing if you're spinning up fresh projects. Pint meanwhile cleaned house by adopting the official `laravel/agent-detector` package [9], shifting a dev dependency where it belongs.
Action items
- → Update laravel/ai if you're tracking image generation token usage laravel/ai [plan]
- → Pull the latest installer if you scaffold new projects with Pest laravel/installer [plan]
- → Review test assertions in existing suites — `assertSessionMissingInput()` is available now laravel/framework [monitor]
References
- [1] Surface usage tokens in OpenAI and Gemini image responses ↗ laravel/ai
- [2] Add image generation support to OpenRouterProvider ↗ laravel/ai
- [3] Add `assertSessionMissingInput` ↗ laravel/framework
- [4] Correct Log\Context\Repository::handleUnserializeExceptionsUsing @return to $this (#59965) laravel/framework
- [5] Correct Attribute caching toggles @return to $this (#59962) laravel/framework
- [6] Correct Factory::configure @return to $this (#59963) laravel/framework
- [7] Correct Translator::handleMissingKeysUsing @return to $this (#59964) laravel/framework
- [8] Fix uncommenting use RefreshDatabase in Pest.php (#516) laravel/installer
- [9] Use `laravel/agent-detector` ↗ laravel/pint
FAQ
- What changed in Laravel on May 2, 2026?
- Laravel AI now surfaces token usage from image generation across OpenAI and Gemini, while the framework ships a long-overdue testing counterpart and the installer fixes a Pest compatibility break.
- What should Laravel teams do about it?
- Update laravel/ai if you're tracking image generation token usage • Pull the latest installer if you scaffold new projects with Pest • Review test assertions in existing suites — `assertSessionMissingInput()` is available now
- Which Laravel repositories shipped on May 2, 2026?
- laravel/ai, laravel/framework, laravel/installer, laravel/pint