Laravel 11.18.1: Smarter Upserts and Cleaner String Clipping
The New Terminating Event
Laravel 11.18.1 introduces a highly specific hook into the request lifecycle: the
Testing Batched Jobs with Ease
Testing complex background processes just got significantly easier. While dispatchedBatches. This method, added to the bus fake, allows you to retrieve the actual batch instances created during a test. Instead of just knowing a batch exists, you can now pull those specific batches and run deep assertions against their properties or the jobs they contain. It turns a "black box" test into a transparent, verifiable process.
Smarter Eloquent Relationship Upserts
Traditionally, using the upsert method on an user_id while calling a relationship on a user model, the database would throw an integrity constraint violation. The latest update fixes this friction.
Word-Aware String Truncation
We’ve all seen the awkward "..." that cuts a word in half, turning a professional headline into a confusing fragment. The Str::limit helper now supports a preserveWords argument. Instead of a hard character cutoff, the helper looks for the nearest full word boundary before the limit. If you set a 20-character limit on a sentence, it won't leave you with a dangling partial word at character 20; it will drop back to the previous full word, ensuring your UI remains clean and legible.
Conclusion
These updates represent the incremental polish that makes
