Laravel 9.11 Released
Published on by Paul Redmond
The Laravel team released 9.11 with an array join method, methods to check the existence of validated input, opt-in deprecation logging, and more:
Add Arr::join() Method
Daniel Eckermann contributed a Arr::join()
method similar to the Collection::join()
method:
$stack = ['Tailwind', 'Alpine', 'Laravel', 'Livewire']; // Tailwind, Alpine, Laravel and LivewireArr::join($stack, ', ', ' and '); // Or if you appreciate the oxford comma :)// Tailwind, Alpine, Laravel, and LivewireArr::join($stack, ', ', ', and ');
Methods to Check the Existence of Validated Input Data
Sam Carré contributed two methods to the ValidatedInput
class to check for the existence of validated input data. These methods are like $request->has()
and $request->missing()
, except only against validated data:
$validatedName = $request->safe()->has('name'); // True$validatedAge = $request->safe()->has('age'); // False $validatedName = $request->safe()->missing('name'); // False$validatedAge = $request->safe()->missing('age'); // True // Check each key in the array$validatedName = $request->safe()->has(['name', 'age']);
Deprecation Stack Trace Config Option
Dries Vints contributed to making deprecation error stack traces opt-in rather than enabled by default. Check out Pull Request #42235 and #42191 for further details on logging deprecation errors.
Release Notes
You can see the complete list of new features and updates below and the diff between 9.10.0 and 9.11.0 on GitHub. The following release notes are directly from the changelog:
v9.11.0
Added
- Added Illuminate/Collections/Arr::join() (#42197)
- Added has and missing methods to ValidatedInput (#42184)
- Added deprecation stack trace config option (#42235)
Fixed
Changed
- Improve EventFake::assertListening() support for subscribers (#42193)