Laravel 12.35: The Update You Didn’t Know You Needed

Laravel 12.35 quietly dropped this week, and while it’s not a headline-grabbing release, it packs several developer-friendly enhancements that make testing, architecture, and debugging smoother than ever.


🧪 PestPHP Gets a Boost

Laravel continues to embrace PestPHP as the default testing experience, and 12.35 adds tighter integration with plugins like:

  • pest-browser: Run Playwright-powered browser tests with Laravel routes and middleware baked in.
  • pest-sharding: Split tests across CI workers for faster pipelines.
  • pest-arch: Validate architectural boundaries (e.g., no controller accessing a service directly).
  • pest-tinker: Interactive debugging inside tests — think dd() but smarter.

These plugins aren’t bundled, but Laravel 12.35 ensures smoother compatibility and better DX when using them.


🧩 Route Constraints Get Smarter

You can now define custom route constraints using closures or invokable classes. This means:

Route::get('/user/{id}', function ($id) {
    // ...
})->where('id', fn ($id) => is_numeric($id) && $id > 0);

No need to register global patterns — just inline logic where you need it.


🧼 Artisan Cleanup Commands

Laravel 12.35 introduces:

  • artisan route:clear-unused — removes unused route definitions
  • artisan config:prune — trims config files based on environment

These are perfect for keeping legacy projects lean and production-ready.


🧠 Smarter Exception Handling

You can now define context-aware exception renderers using closures:

renderable(function (ValidationException $e, $request) {
    return response()->json(['errors' => $e->errors()], 422);
});

This gives you more control over how exceptions behave across APIs, web routes, and CLI.


🧪 Test Coverage Improvements

Laravel’s built-in coverage reporting now supports type coverage and dead code detection when paired with PestPHP and Xdebug. This helps teams write cleaner, safer code — and catch unused logic before it ships.


🧰 Miscellaneous Goodies

  • Improved support for readonly properties in models
  • Better Blade component slot scoping
  • Minor performance boosts in queue workers and event broadcasting

💬 Final Thoughts

Laravel 12.35 isn’t a flashy release — but it’s a thoughtful one. It tightens the developer experience, improves testability, and gives you more control over routing, exceptions, and cleanup.

If you’re building SaaS tools, APIs, or just want cleaner code, this release is worth the upgrade.

Leave a Reply

Your email address will not be published. Required fields are marked *