A patch release with fixes for translation, view, facade and laravel/ai type inference.
Fixes
- Accept
Closurevalues in the$replaceargument of__(), matching how Laravel's translator calls them with the matched text (#1444)
__('some.key', ['name' => fn (string $matched): string => strtoupper($matched)]);
-// InvalidArgument: Argument 2 of __ expects array<string, null|scalar>, but array{name: pure-Closure(...)} provided
+// accepted, returns string- Report
MissingViewfor$this->view()in test cases usingInteractsWithViews(opt-in viafindMissingViews) (#1445)
final class WelcomeTest extends \Illuminate\Foundation\Testing\TestCase
{
public function test_it_renders(): void
{
$this->view('does.not.exist')->assertSee('hello');
- // no issue
+ // MissingView: View 'does.not.exist' not found in any of the registered view paths
}
}- Narrow
App::environment()toboolwhen called with environment names, and tostringwith no arguments (#1453)
$isLive = App::environment(['production', 'staging']);
-// string|bool
+// bool- 🛡️ Treat
Laravel\Ai\Tools\Request::validate()as a taint source like the class's other data accessors: validation constrains shape, not content, so the returned values are still attacker-controlled (#1446)
Full Changelog: v3.16.1...v3.16.2