From 6d584e5b5702e8207fcc62b72c265402f6dbad2c Mon Sep 17 00:00:00 2001 From: Mark Beech Date: Thu, 22 Jun 2023 12:22:57 +0100 Subject: [PATCH 01/24] [10.x] Allow `%` symbol in component attribute names (#47533) * Allow `%` symbol in attribute names * Update tests --- src/Illuminate/View/Compilers/ComponentTagCompiler.php | 6 +++--- tests/View/Blade/BladeComponentTagCompilerTest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/View/Compilers/ComponentTagCompiler.php b/src/Illuminate/View/Compilers/ComponentTagCompiler.php index f052cf3bcc59..8b360762127e 100644 --- a/src/Illuminate/View/Compilers/ComponentTagCompiler.php +++ b/src/Illuminate/View/Compilers/ComponentTagCompiler.php @@ -128,7 +128,7 @@ protected function compileOpeningTags(string $value) ) | (?: - [\w\-:.@]+ + [\w\-:.@%]+ ( = (?: @@ -193,7 +193,7 @@ protected function compileSelfClosingTags(string $value) ) | (?: - [\w\-:.@]+ + [\w\-:.@%]+ ( = (?: @@ -588,7 +588,7 @@ protected function getAttributesFromAttributeString(string $attributeString) $attributeString = $this->parseBindAttributes($attributeString); $pattern = '/ - (?[\w\-:.@]+) + (?[\w\-:.@%]+) ( = (? diff --git a/tests/View/Blade/BladeComponentTagCompilerTest.php b/tests/View/Blade/BladeComponentTagCompilerTest.php index 2e67e0310d6e..ec100b50ee58 100644 --- a/tests/View/Blade/BladeComponentTagCompilerTest.php +++ b/tests/View/Blade/BladeComponentTagCompilerTest.php @@ -100,13 +100,13 @@ public function testBasicComponentParsing() { $this->mockViewFactory(); - $result = $this->compiler(['alert' => TestAlertComponent::class])->compileTags('
'); + $result = $this->compiler(['alert' => TestAlertComponent::class])->compileTags('
'); $this->assertSame("
##BEGIN-COMPONENT-CLASS##@component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', []) getConstructor()): ?> except(collect(\$constructor->getParameters())->map->getName()->all()); ?> -withAttributes(['type' => 'foo','limit' => '5','@click' => 'foo','wire:click' => 'changePlan(\''.e(\$plan).'\')','required' => true]); ?>\n". +withAttributes(['type' => 'foo','limit' => '5','@click' => 'foo','wire:click' => 'changePlan(\''.e(\$plan).'\')','required' => true,'x-intersect.margin.-50%.0px' => 'visibleSection = \'profile\'']); ?>\n". "@endComponentClass##END-COMPONENT-CLASS####BEGIN-COMPONENT-CLASS##@component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', []) getConstructor()): ?> except(collect(\$constructor->getParameters())->map->getName()->all()); ?> From b4ab62986000eaa411a22dbeb112b21c10420fdc Mon Sep 17 00:00:00 2001 From: Dante <35383529+srdante@users.noreply.github.com> Date: Thu, 22 Jun 2023 08:23:55 -0300 Subject: [PATCH 02/24] Fix Http client pool @return type (#47530) --- src/Illuminate/Http/Client/Pool.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Http/Client/Pool.php b/src/Illuminate/Http/Client/Pool.php index 7aed87f88a19..0704df33226a 100644 --- a/src/Illuminate/Http/Client/Pool.php +++ b/src/Illuminate/Http/Client/Pool.php @@ -78,7 +78,7 @@ public function getRequests() * * @param string $method * @param array $parameters - * @return \Illuminate\Http\Client\PendingRequest + * @return \Illuminate\Http\Client\PendingRequest|\GuzzleHttp\Promise\Promise */ public function __call($method, $parameters) { From 973b54ed201cdf1ec820699831e39189327ae17e Mon Sep 17 00:00:00 2001 From: Ostap Brehin Date: Fri, 23 Jun 2023 14:32:04 +0100 Subject: [PATCH 03/24] [10.x] Use `match` expression in `resolveSynchronousFake` (#47540) * [10.x] Use `match` expression in `resolveSynchronousFake` * StyleCI fix --- src/Illuminate/Process/PendingProcess.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Illuminate/Process/PendingProcess.php b/src/Illuminate/Process/PendingProcess.php index 7ed3dd6f1eaa..c65eac0ba082 100644 --- a/src/Illuminate/Process/PendingProcess.php +++ b/src/Illuminate/Process/PendingProcess.php @@ -361,17 +361,15 @@ protected function resolveSynchronousFake(string $command, Closure $fake) if (is_string($result) || is_array($result)) { return (new FakeProcessResult(output: $result))->withCommand($command); - } elseif ($result instanceof ProcessResult) { - return $result; - } elseif ($result instanceof FakeProcessResult) { - return $result->withCommand($command); - } elseif ($result instanceof FakeProcessDescription) { - return $result->toProcessResult($command); - } elseif ($result instanceof FakeProcessSequence) { - return $this->resolveSynchronousFake($command, fn () => $result()); } - throw new LogicException('Unsupported synchronous process fake result provided.'); + return match (true) { + $result instanceof ProcessResult => $result, + $result instanceof FakeProcessResult => $result->withCommand($command), + $result instanceof FakeProcessDescription => $result->toProcessResult($command), + $result instanceof FakeProcessSequence => $this->resolveSynchronousFake($command, fn () => $result()), + default => throw new LogicException('Unsupported synchronous process fake result provided.'), + }; } /** From 32bb133c49cbb45a49a424c19b31b510a0ece2fc Mon Sep 17 00:00:00 2001 From: Ostap Brehin Date: Fri, 23 Jun 2023 22:57:20 +0100 Subject: [PATCH 04/24] [10.x] Use `match` expression in `compileHaving` (#47548) --- .../Database/Query/Grammars/Grammar.php | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/Illuminate/Database/Query/Grammars/Grammar.php b/src/Illuminate/Database/Query/Grammars/Grammar.php index a1c2d538198e..42921e129dbf 100755 --- a/src/Illuminate/Database/Query/Grammars/Grammar.php +++ b/src/Illuminate/Database/Query/Grammars/Grammar.php @@ -754,23 +754,16 @@ protected function compileHaving(array $having) // If the having clause is "raw", we can just return the clause straight away // without doing any more processing on it. Otherwise, we will compile the // clause into SQL based on the components that make it up from builder. - if ($having['type'] === 'Raw') { - return $having['sql']; - } elseif ($having['type'] === 'between') { - return $this->compileHavingBetween($having); - } elseif ($having['type'] === 'Null') { - return $this->compileHavingNull($having); - } elseif ($having['type'] === 'NotNull') { - return $this->compileHavingNotNull($having); - } elseif ($having['type'] === 'bit') { - return $this->compileHavingBit($having); - } elseif ($having['type'] === 'Expression') { - return $this->compileHavingExpression($having); - } elseif ($having['type'] === 'Nested') { - return $this->compileNestedHavings($having); - } - - return $this->compileBasicHaving($having); + return match ($having['type']) { + 'Raw' => $having['sql'], + 'between' => $this->compileHavingBetween($having), + 'Null' => $this->compileHavingNull($having), + 'NotNull' => $this->compileHavingNotNull($having), + 'bit' => $this->compileHavingBit($having), + 'Expression' => $this->compileHavingExpression($having), + 'Nested' => $this->compileNestedHavings($having), + default => $this->compileBasicHaving($having), + }; } /** From a53d88176c031c3c32e076663f7c18dd36cecf5a Mon Sep 17 00:00:00 2001 From: Ostap Brehin Date: Fri, 23 Jun 2023 22:58:46 +0100 Subject: [PATCH 05/24] [10.x] Use `match` expression in `getArrayableItems` (#47549) --- .../Collections/Traits/EnumeratesValues.php | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/Illuminate/Collections/Traits/EnumeratesValues.php b/src/Illuminate/Collections/Traits/EnumeratesValues.php index f9614963ae36..d008486b031f 100644 --- a/src/Illuminate/Collections/Traits/EnumeratesValues.php +++ b/src/Illuminate/Collections/Traits/EnumeratesValues.php @@ -972,21 +972,17 @@ protected function getArrayableItems($items) { if (is_array($items)) { return $items; - } elseif ($items instanceof Enumerable) { - return $items->all(); - } elseif ($items instanceof Arrayable) { - return $items->toArray(); - } elseif ($items instanceof Traversable) { - return iterator_to_array($items); - } elseif ($items instanceof Jsonable) { - return json_decode($items->toJson(), true); - } elseif ($items instanceof JsonSerializable) { - return (array) $items->jsonSerialize(); - } elseif ($items instanceof UnitEnum) { - return [$items]; } - return (array) $items; + return match (true) { + $items instanceof Enumerable => $items->all(), + $items instanceof Arrayable => $items->toArray(), + $items instanceof Traversable => iterator_to_array($items), + $items instanceof Jsonable => json_decode($items->toJson(), true), + $items instanceof JsonSerializable => (array) $items->jsonSerialize(), + $items instanceof UnitEnum => [$items], + default => (array) $items, + }; } /** From 2869b253aed58b7126fc87485cc03b701f594a57 Mon Sep 17 00:00:00 2001 From: Perry van der Meer <11609290+PerryvanderMeer@users.noreply.github.com> Date: Sat, 24 Jun 2023 16:28:12 +0200 Subject: [PATCH 06/24] Update SessionGuard.php (#47553) --- src/Illuminate/Auth/SessionGuard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Auth/SessionGuard.php b/src/Illuminate/Auth/SessionGuard.php index 769edb204330..b475dbc6ca2e 100644 --- a/src/Illuminate/Auth/SessionGuard.php +++ b/src/Illuminate/Auth/SessionGuard.php @@ -914,7 +914,7 @@ public function getUser() * Set the current user. * * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return void + * @return $this */ public function setUser(AuthenticatableContract $user) { From cdc89bd47ab0a95de27c21e5204d5705e278fac0 Mon Sep 17 00:00:00 2001 From: Perry van der Meer <11609290+PerryvanderMeer@users.noreply.github.com> Date: Sat, 24 Jun 2023 16:29:08 +0200 Subject: [PATCH 07/24] Update DatabaseQueue.php (#47552) --- src/Illuminate/Queue/DatabaseQueue.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Queue/DatabaseQueue.php b/src/Illuminate/Queue/DatabaseQueue.php index bce025c53340..c650f7c480fe 100644 --- a/src/Illuminate/Queue/DatabaseQueue.php +++ b/src/Illuminate/Queue/DatabaseQueue.php @@ -118,7 +118,7 @@ public function pushRaw($payload, $queue = null, array $options = []) * @param string $job * @param mixed $data * @param string|null $queue - * @return void + * @return mixed */ public function later($delay, $job, $data = '', $queue = null) { From 0a9c5df30083d9554e8495fb22208f21c998cd82 Mon Sep 17 00:00:00 2001 From: Perry van der Meer <11609290+PerryvanderMeer@users.noreply.github.com> Date: Sat, 24 Jun 2023 19:34:20 +0200 Subject: [PATCH 08/24] Update DumpCommand.php (#47556) --- src/Illuminate/Database/Console/DumpCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Console/DumpCommand.php b/src/Illuminate/Database/Console/DumpCommand.php index 5e839b1d4218..27121281a3fa 100644 --- a/src/Illuminate/Database/Console/DumpCommand.php +++ b/src/Illuminate/Database/Console/DumpCommand.php @@ -36,7 +36,7 @@ class DumpCommand extends Command * * @param \Illuminate\Database\ConnectionResolverInterface $connections * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher - * @return int + * @return void */ public function handle(ConnectionResolverInterface $connections, Dispatcher $dispatcher) { From bf491135813342e5316451760d279ba01ec6012a Mon Sep 17 00:00:00 2001 From: Perry van der Meer <11609290+PerryvanderMeer@users.noreply.github.com> Date: Sat, 24 Jun 2023 19:34:31 +0200 Subject: [PATCH 09/24] Update MigrateMakeCommand.php (#47557) --- .../Database/Console/Migrations/MigrateMakeCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php b/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php index ea6b340ffb45..bbec9a768682 100644 --- a/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php +++ b/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php @@ -103,7 +103,7 @@ public function handle() * @param string $name * @param string $table * @param bool $create - * @return string + * @return void */ protected function writeMigration($name, $table, $create) { From c262c1ffce93c5fa4b9e00da1a54d8c02ddddcf6 Mon Sep 17 00:00:00 2001 From: Perry van der Meer <11609290+PerryvanderMeer@users.noreply.github.com> Date: Sat, 24 Jun 2023 20:02:28 +0200 Subject: [PATCH 10/24] Update Factory.php (#47559) --- src/Illuminate/Process/Factory.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Illuminate/Process/Factory.php b/src/Illuminate/Process/Factory.php index 51ed037ec9a9..9db688237667 100644 --- a/src/Illuminate/Process/Factory.php +++ b/src/Illuminate/Process/Factory.php @@ -212,6 +212,8 @@ public function assertRanTimes(Closure|string $callback, int $times = 1) $times, $count, "An expected process ran {$count} times instead of {$times} times." ); + + return $this; } /** From bc1e0ca22bdd2dbfa2464cfc9c69666204bea1f6 Mon Sep 17 00:00:00 2001 From: Alireza Date: Sun, 25 Jun 2023 18:06:40 +0330 Subject: [PATCH 11/24] [10.x] Update doc in Eloquent model (#47562) --- src/Illuminate/Database/Eloquent/Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index c185c5be573b..106b8a79d9d6 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -746,7 +746,7 @@ public function loadMissing($relations) * * @param array|string $relations * @param string $column - * @param string $function + * @param string|null $function * @return $this */ public function loadAggregate($relations, $column, $function = null) @@ -834,7 +834,7 @@ public function loadExists($relations) * @param string $relation * @param array $relations * @param string $column - * @param string $function + * @param string|null $function * @return $this */ public function loadMorphAggregate($relation, $relations, $column, $function = null) From aef89589ea70e0081c139b06550220cc75f20ea6 Mon Sep 17 00:00:00 2001 From: Perry van der Meer <11609290+PerryvanderMeer@users.noreply.github.com> Date: Sun, 25 Jun 2023 16:37:39 +0200 Subject: [PATCH 12/24] [10.x] Fix return types (#47561) * Update Signals.php * Update RedisStore.php --- src/Illuminate/Cache/RedisStore.php | 2 +- src/Illuminate/Console/Signals.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Cache/RedisStore.php b/src/Illuminate/Cache/RedisStore.php index 4d03745147e9..437cee78136d 100755 --- a/src/Illuminate/Cache/RedisStore.php +++ b/src/Illuminate/Cache/RedisStore.php @@ -253,7 +253,7 @@ public function flush() /** * Remove all expired tag set entries. * - * @return bool + * @return void */ public function flushStaleTags() { diff --git a/src/Illuminate/Console/Signals.php b/src/Illuminate/Console/Signals.php index 92a5c87098d6..106b54d14319 100644 --- a/src/Illuminate/Console/Signals.php +++ b/src/Illuminate/Console/Signals.php @@ -84,7 +84,7 @@ protected function initializeSignal($signal) /** * Unregister the current signal handlers. * - * @return array> + * @return void */ public function unregister() { From 7a03161ed2495f886df2a6773a3522783c408029 Mon Sep 17 00:00:00 2001 From: Fernando Garcia Date: Mon, 26 Jun 2023 11:20:27 -0600 Subject: [PATCH 13/24] [10.x] Fix PHPDoc throw type (#47566) --- src/Illuminate/Log/ParsesLogConfiguration.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Illuminate/Log/ParsesLogConfiguration.php b/src/Illuminate/Log/ParsesLogConfiguration.php index 5b245597650d..b658575ad607 100644 --- a/src/Illuminate/Log/ParsesLogConfiguration.php +++ b/src/Illuminate/Log/ParsesLogConfiguration.php @@ -54,6 +54,8 @@ protected function level(array $config) * * @param array $config * @return int + * + * @throws \InvalidArgumentException */ protected function actionLevel(array $config) { From 3558da85976d677fa1169f8ccb653b7872eccb18 Mon Sep 17 00:00:00 2001 From: indykoning <15870933+indykoning@users.noreply.github.com> Date: Mon, 26 Jun 2023 19:56:36 +0200 Subject: [PATCH 14/24] [10.x] Add hasAny function to ComponentAttributeBag, Allow multiple keys in has function (#47569) * Add hasAny function to ComponentAttributeBag, Allow multiple keys in has function * Update ComponentAttributeBag.php * Update ComponentAttributeBag.php --------- Co-authored-by: Taylor Otwell --- src/Illuminate/View/ComponentAttributeBag.php | 37 +++++++++++++++++-- tests/View/ViewComponentAttributeBagTest.php | 6 +++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/View/ComponentAttributeBag.php b/src/Illuminate/View/ComponentAttributeBag.php index ab100cf3c173..1d0a790b4256 100644 --- a/src/Illuminate/View/ComponentAttributeBag.php +++ b/src/Illuminate/View/ComponentAttributeBag.php @@ -61,12 +61,43 @@ public function get($key, $default = null) /** * Determine if a given attribute exists in the attribute array. * - * @param string $key + * @param array|string $key * @return bool */ public function has($key) { - return array_key_exists($key, $this->attributes); + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if (! array_key_exists($value, $this->attributes)) { + return false; + } + } + + return true; + } + + /** + * Determine if any of the keys exist in the attribute array. + * + * @param array|string $key + * @return bool + */ + public function hasAny($key) + { + if (! count($this->attributes)) { + return false; + } + + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if ($this->has($value)) { + return true; + } + } + + return false; } /** @@ -77,7 +108,7 @@ public function has($key) */ public function missing($key) { - return ! $this->has($key, $this->attributes); + return ! $this->has($key); } /** diff --git a/tests/View/ViewComponentAttributeBagTest.php b/tests/View/ViewComponentAttributeBagTest.php index ff5437ccbc96..24451361c050 100644 --- a/tests/View/ViewComponentAttributeBagTest.php +++ b/tests/View/ViewComponentAttributeBagTest.php @@ -118,8 +118,14 @@ public function testAttibuteExistence() $bag = new ComponentAttributeBag(['name' => 'test']); $this->assertTrue((bool) $bag->has('name')); + $this->assertTrue((bool) $bag->has(['name'])); + $this->assertTrue((bool) $bag->hasAny(['class', 'name'])); + $this->assertTrue((bool) $bag->hasAny('class', 'name')); $this->assertFalse((bool) $bag->missing('name')); $this->assertFalse((bool) $bag->has('class')); + $this->assertFalse((bool) $bag->has(['class'])); + $this->assertFalse((bool) $bag->has(['name', 'class'])); + $this->assertFalse((bool) $bag->has('name', 'class')); $this->assertTrue((bool) $bag->missing('class')); } } From be745b8e0bdd7e77f13073b57d26c560abff30b3 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Tue, 27 Jun 2023 03:57:46 +1000 Subject: [PATCH 15/24] [10.x] Ensure captured time is in configured timezone (#47567) * Ensure captured time is in configured timezone * Update Kernel.php --- src/Illuminate/Foundation/Console/Kernel.php | 2 ++ src/Illuminate/Foundation/Http/Kernel.php | 2 ++ .../Console/CommandDurationThresholdTest.php | 21 +++++++++++++++++++ .../Http/RequestDurationThresholdTest.php | 20 ++++++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/src/Illuminate/Foundation/Console/Kernel.php b/src/Illuminate/Foundation/Console/Kernel.php index 334b3a401b43..8180435b5869 100644 --- a/src/Illuminate/Foundation/Console/Kernel.php +++ b/src/Illuminate/Foundation/Console/Kernel.php @@ -218,6 +218,8 @@ public function terminate($input, $status) { $this->app->terminate(); + $this->commandStartedAt->setTimezone($this->app['config']->get('app.timezone') ?? 'UTC'); + foreach ($this->commandLifecycleDurationHandlers as ['threshold' => $threshold, 'handler' => $handler]) { $end ??= Carbon::now(); diff --git a/src/Illuminate/Foundation/Http/Kernel.php b/src/Illuminate/Foundation/Http/Kernel.php index e91543cd0c77..784c3e98d6ea 100644 --- a/src/Illuminate/Foundation/Http/Kernel.php +++ b/src/Illuminate/Foundation/Http/Kernel.php @@ -214,6 +214,8 @@ public function terminate($request, $response) $this->app->terminate(); + $this->requestStartedAt->setTimezone($this->app['config']->get('app.timezone') ?? 'UTC'); + foreach ($this->requestLifecycleDurationHandlers as ['threshold' => $threshold, 'handler' => $handler]) { $end ??= Carbon::now(); diff --git a/tests/Integration/Console/CommandDurationThresholdTest.php b/tests/Integration/Console/CommandDurationThresholdTest.php index 3c4aaa6b825a..939264e8b40e 100644 --- a/tests/Integration/Console/CommandDurationThresholdTest.php +++ b/tests/Integration/Console/CommandDurationThresholdTest.php @@ -5,6 +5,7 @@ use Carbon\CarbonInterval; use Illuminate\Contracts\Console\Kernel; use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Config; use Orchestra\Testbench\TestCase; use Symfony\Component\Console\Input\StringInput; use Symfony\Component\Console\Output\ConsoleOutput; @@ -177,4 +178,24 @@ public function testItClearsStartTimeAfterHandlingCommand() $kernel->terminate($input, 21); $this->assertNull($kernel->commandStartedAt()); } + + public function testUsesTheConfiguredDateTimezone() + { + Config::set('app.timezone', 'UTC'); + $startedAt = null; + $kernel = $this->app[Kernel::class]; + $kernel->command('foo', fn () => null); + $kernel->whenCommandLifecycleIsLongerThan(0, function ($started) use (&$startedAt) { + $startedAt = $started; + }); + + Config::set('app.timezone', 'Australia/Melbourne'); + Carbon::setTestNow(Carbon::now()); + $kernel->handle($input = new StringInput('foo'), new ConsoleOutput); + + Carbon::setTestNow(now()->addMinute()); + $kernel->terminate($input, 21); + + $this->assertSame('Australia/Melbourne', $startedAt->timezone->getName()); + } } diff --git a/tests/Integration/Http/RequestDurationThresholdTest.php b/tests/Integration/Http/RequestDurationThresholdTest.php index 2a9f4fd4ac11..421981dda0eb 100644 --- a/tests/Integration/Http/RequestDurationThresholdTest.php +++ b/tests/Integration/Http/RequestDurationThresholdTest.php @@ -7,6 +7,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Route; use Orchestra\Testbench\TestCase; @@ -72,6 +73,25 @@ public function testItProvidesRequestToHandler() $this->assertSame('http://localhost/test-route', $url); } + public function testUsesTheConfiguredDateTimezone() + { + Config::set('app.timezone', 'UTC'); + Route::get('test-route', fn () => 'ok'); + $kernel = $this->app[Kernel::class]; + $startedAt = null; + $kernel->whenRequestLifecycleIsLongerThan(CarbonInterval::seconds(1), function ($started) use (&$startedAt) { + $startedAt = $started; + }); + + Config::set('app.timezone', 'Australia/Melbourne'); + Carbon::setTestNow(now()->startOfDay()); + $kernel->handle($request = Request::create('http://localhost/test-route')); + Carbon::setTestNow(now()->addMinute()); + $kernel->terminate($request, new Response); + + $this->assertSame('Australia/Melbourne', $startedAt->timezone->getName()); + } + public function testItCanExceedThresholdWhenSpecifyingDurationAsMilliseconds() { Route::get('test-route', fn () => 'ok'); From 9f366f6440858b2d80ddc6321693930bd7d66118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Harkes?= Date: Mon, 26 Jun 2023 20:07:19 +0200 Subject: [PATCH 16/24] [10.x] Add Method to Report only logged exceptions (#47554) * add report error * Fix linting * fix linting * rename method --------- Co-authored-by: Taylor Otwell --- src/Illuminate/Foundation/Exceptions/Handler.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Illuminate/Foundation/Exceptions/Handler.php b/src/Illuminate/Foundation/Exceptions/Handler.php index 4a5b3bd30842..d6d92ed60296 100644 --- a/src/Illuminate/Foundation/Exceptions/Handler.php +++ b/src/Illuminate/Foundation/Exceptions/Handler.php @@ -247,6 +247,19 @@ public function report(Throwable $e) return; } + $this->reportThrowable($e); + } + + /** + * Reports error based on report method on exception or to logger. + * + * @param \Throwable $e + * @return void + * + * @throws \Throwable + */ + protected function reportThrowable(Throwable $e): void + { if (Reflector::isCallable($reportCallable = [$e, 'report']) && $this->container->call($reportCallable) !== false) { return; From b772693dc507973b438f519054c6cc15d5b0d162 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Tue, 27 Jun 2023 04:32:54 +1000 Subject: [PATCH 17/24] [10.x] Add global middleware to `Http` client (#47525) * Add on request callback hook to the http client * Rename test * Support replacing and adding headers. * Rename method so it doesn't conflict * Support global guzzle middleware * Remove beforesending hook * Remove request header methods * lint * Add named methods --- src/Illuminate/Http/Client/Factory.php | 49 ++++++- src/Illuminate/Http/Client/PendingRequest.php | 32 ++++- tests/Http/HttpClientTest.php | 123 ++++++++++++++++++ 3 files changed, 201 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Http/Client/Factory.php b/src/Illuminate/Http/Client/Factory.php index ab0c0c53a001..6c24ed4ea08e 100644 --- a/src/Illuminate/Http/Client/Factory.php +++ b/src/Illuminate/Http/Client/Factory.php @@ -3,6 +3,7 @@ namespace Illuminate\Http\Client; use Closure; +use GuzzleHttp\Middleware; use GuzzleHttp\Promise\Create; use GuzzleHttp\Promise\PromiseInterface; use GuzzleHttp\Psr7\Response as Psr7Response; @@ -28,6 +29,13 @@ class Factory */ protected $dispatcher; + /** + * The middleware to apply to every request. + * + * @var array + */ + protected $globalMiddleware = []; + /** * The stub callables that will handle requests. * @@ -76,6 +84,45 @@ public function __construct(Dispatcher $dispatcher = null) $this->stubCallbacks = collect(); } + /** + * Add middleware to apply to every request. + * + * @param callable $middleware + * @return $this + */ + public function globalMiddleware($middleware) + { + $this->globalMiddleware[] = $middleware; + + return $this; + } + + /** + * Add request middleware to apply to every request. + * + * @param callable $middleware + * @return $this + */ + public function globalRequestMiddleware($middleware) + { + $this->globalMiddleware[] = Middleware::mapRequest($middleware); + + return $this; + } + + /** + * Add response middleware to apply to every request. + * + * @param callable $middleware + * @return $this + */ + public function globalResponseMiddleware($middleware) + { + $this->globalMiddleware[] = Middleware::mapResponse($middleware); + + return $this; + } + /** * Create a new response instance for use during stubbing. * @@ -353,7 +400,7 @@ public function recorded($callback = null) */ protected function newPendingRequest() { - return new PendingRequest($this); + return new PendingRequest($this, $this->globalMiddleware); } /** diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index d6689ccc4d0e..3ad18ed12e5f 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -10,6 +10,7 @@ use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Exception\TransferException; use GuzzleHttp\HandlerStack; +use GuzzleHttp\Middleware; use GuzzleHttp\UriTemplate\UriTemplate; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Http\Client\Events\ConnectionFailed; @@ -216,12 +217,13 @@ class PendingRequest * Create a new HTTP Client instance. * * @param \Illuminate\Http\Client\Factory|null $factory + * @param array $middleware * @return void */ - public function __construct(Factory $factory = null) + public function __construct(Factory $factory = null, $middleware = []) { $this->factory = $factory; - $this->middleware = new Collection; + $this->middleware = new Collection($middleware); $this->asJson(); @@ -641,6 +643,32 @@ public function withMiddleware(callable $middleware) return $this; } + /** + * Add new request middleware the client handler stack. + * + * @param callable $middleware + * @return $this + */ + public function withRequestMiddleware(callable $middleware) + { + $this->middleware->push(Middleware::mapRequest($middleware)); + + return $this; + } + + /** + * Add new response middleware the client handler stack. + * + * @param callable $middleware + * @return $this + */ + public function withResponseMiddleware(callable $middleware) + { + $this->middleware->push(Middleware::mapResponse($middleware)); + + return $this; + } + /** * Add a new "before sending" callback to the request. * diff --git a/tests/Http/HttpClientTest.php b/tests/Http/HttpClientTest.php index 043ef3d75aef..dce99facefb1 100644 --- a/tests/Http/HttpClientTest.php +++ b/tests/Http/HttpClientTest.php @@ -20,6 +20,7 @@ use Illuminate\Http\Client\ResponseSequence; use Illuminate\Http\Response as HttpResponse; use Illuminate\Support\Arr; +use Illuminate\Support\Carbon; use Illuminate\Support\Collection; use Illuminate\Support\Fluent; use Illuminate\Support\Str; @@ -28,6 +29,7 @@ use OutOfBoundsException; use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\TestCase; +use Psr\Http\Message\ResponseInterface; use RuntimeException; use Symfony\Component\VarDumper\VarDumper; @@ -2374,4 +2376,125 @@ public function testTheTransferStatsAreCustomizableOnFake(): void $this->assertTrue($onStatsFunctionCalled); } + + public function testItCanAddGlobalMiddleware() + { + Carbon::setTestNow(now()->startOfDay()); + $requests = []; + $responses = []; + $this->factory->fake(function ($r) use (&$requests) { + $requests[] = $r; + + Carbon::setTestNow(now()->addSeconds(6 * count($requests))); + + return $this->factory::response('expected content'); + }); + + $this->factory->globalMiddleware(Middleware::mapRequest(function ($request) { + // Test manipulating headers on outgoing request... + return $request->withHeader('User-Agent', 'Laravel Framework/1.0') + ->withAddedHeader('shared', 'global') + ->withHeader('list', ['item-1', 'item-2']) + ->withAddedHeader('list', ['item-3']); + }))->globalMiddleware(Middleware::mapResponse(function ($response) use (&$requests) { + // Test adding headers in incoming response.. + return $response->withHeader('X-Count', (string) count($requests)); + }))->globalMiddleware(function ($handler) { + // Test wrapping request in timing function... + return function ($request, $options) use ($handler) { + $startedAt = now(); + + return $handler($request, $options)->then(function (ResponseInterface $response) use ($startedAt) { + return $response->withHeader('X-Duration', "{$startedAt->diffInSeconds(now())} seconds"); + }); + }; + }); + $responses[] = $this->factory->post('http://forge.laravel.com'); + $responses[] = $this->factory->withHeader('shared', 'local')->post('http://vapor.laravel.com'); + + $this->assertCount(2, $requests); + $this->assertCount(2, $responses); + + $this->assertSame(['Laravel Framework/1.0'], $requests[0]->header('User-Agent')); + $this->assertSame(['item-1', 'item-2', 'item-3'], $requests[0]->header('list')); + $this->assertSame(['global'], $requests[0]->header('shared')); + $this->assertSame('1', $responses[0]->header('X-Count')); + $this->assertSame('6 seconds', $responses[0]->header('X-Duration')); + + $this->assertSame(['Laravel Framework/1.0'], $requests[1]->header('User-Agent')); + $this->assertSame(['item-1', 'item-2', 'item-3'], $requests[1]->header('list')); + $this->assertSame(['local', 'global'], $requests[1]->header('shared')); + $this->assertSame('2', $responses[1]->header('X-Count')); + $this->assertSame('12 seconds', $responses[1]->header('X-Duration')); + } + + public function testItCanAddGlobalRequestMiddleware() + { + $requests = []; + $this->factory->fake(function ($r) use (&$requests) { + $requests[] = $r; + + return Factory::response('expected content'); + }); + + $this->factory->globalRequestMiddleware(function ($request) { + return $request->withHeader('User-Agent', 'Laravel Framework/1.0'); + }); + $this->factory->post('http://forge.laravel.com'); + $this->factory->post('http://laravel.com'); + + $this->assertSame(['Laravel Framework/1.0'], $requests[0]->header('User-Agent')); + $this->assertSame(['Laravel Framework/1.0'], $requests[1]->header('User-Agent')); + } + + public function testItCanAddGlobalResponseMiddleware() + { + $responses = []; + $this->factory->fake(function ($r) use (&$request) { + return Factory::response('expected content'); + }); + + $this->factory->globalResponseMiddleware(function ($response) { + return $response->withHeader('X-Foo', 'Bar'); + }); + $responses[] = $this->factory->post('http://forge.laravel.com'); + $responses[] = $this->factory->post('http://laravel.com'); + + $this->assertSame('Bar', $responses[0]->header('X-Foo')); + $this->assertSame('Bar', $responses[1]->header('X-Foo')); + } + + public function testItCanAddRequestMiddleware() + { + $requests = []; + $this->factory->fake(function ($r) use (&$requests) { + $requests[] = $r; + + return Factory::response('expected content'); + }); + + $this->factory->withRequestMiddleware(function ($request) { + return $request->withHeader('User-Agent', 'Laravel Framework/1.0'); + })->post('http://forge.laravel.com'); + $this->factory->post('http://laravel.com'); + + $this->assertSame(['Laravel Framework/1.0'], $requests[0]->header('User-Agent')); + $this->assertSame(['GuzzleHttp/7'], $requests[1]->header('User-Agent')); + } + + public function testItCanAddResponseMiddleware() + { + $responses = []; + $this->factory->fake(function ($r) use (&$request) { + return Factory::response('expected content'); + }); + + $responses[] = $this->factory->withResponseMiddleware(function ($response) { + return $response->withHeader('X-Foo', 'Bar'); + })->post('http://forge.laravel.com'); + $responses[] = $this->factory->post('http://laravel.com'); + + $this->assertSame('Bar', $responses[0]->header('X-Foo')); + $this->assertSame('', $responses[1]->header('X-Foo')); + } } From 5152d0490d7448c7b1193dd38c5f8a8295f48468 Mon Sep 17 00:00:00 2001 From: taylorotwell Date: Mon, 26 Jun 2023 18:33:29 +0000 Subject: [PATCH 18/24] Update facade docblocks --- src/Illuminate/Support/Facades/Http.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Illuminate/Support/Facades/Http.php b/src/Illuminate/Support/Facades/Http.php index 6abe2aac1179..5cee266a70ad 100644 --- a/src/Illuminate/Support/Facades/Http.php +++ b/src/Illuminate/Support/Facades/Http.php @@ -5,6 +5,9 @@ use Illuminate\Http\Client\Factory; /** + * @method static \Illuminate\Http\Client\Factory globalMiddleware(callable $middleware) + * @method static \Illuminate\Http\Client\Factory globalRequestMiddleware(callable $middleware) + * @method static \Illuminate\Http\Client\Factory globalResponseMiddleware(callable $middleware) * @method static \GuzzleHttp\Promise\PromiseInterface response(array|string|null $body = null, int $status = 200, array $headers = []) * @method static \Illuminate\Http\Client\ResponseSequence sequence(array $responses = []) * @method static \Illuminate\Http\Client\Factory allowStrayRequests() @@ -51,6 +54,8 @@ * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, Closure|int $sleepMilliseconds = 0, callable|null $when = null, bool $throw = true) * @method static \Illuminate\Http\Client\PendingRequest withOptions(array $options) * @method static \Illuminate\Http\Client\PendingRequest withMiddleware(callable $middleware) + * @method static \Illuminate\Http\Client\PendingRequest withRequestMiddleware(callable $middleware) + * @method static \Illuminate\Http\Client\PendingRequest withResponseMiddleware(callable $middleware) * @method static \Illuminate\Http\Client\PendingRequest beforeSending(callable $callback) * @method static \Illuminate\Http\Client\PendingRequest throw(callable|null $callback = null) * @method static \Illuminate\Http\Client\PendingRequest throwIf(callable|bool $condition, callable|null $throwCallback = null) From a6ed3e6a74293d8d275dc7eeb86aefbac7dd8cc4 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 27 Jun 2023 21:16:59 +0800 Subject: [PATCH 19/24] [9.x] Fixes unable to use `trans()->has()` on JSON language files. (#47582) * [9.x] Fixes unable to use `tran()->has()` on JSON language files. Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki --------- Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Translation/Translator.php | 13 +++++- .../Translation/TranslatorTest.php | 43 +++++++++++++++++++ tests/Integration/Translation/lang/en.json | 7 +++ tests/Integration/Translation/lang/fr.json | 6 +++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 tests/Integration/Translation/TranslatorTest.php create mode 100644 tests/Integration/Translation/lang/en.json create mode 100644 tests/Integration/Translation/lang/fr.json diff --git a/src/Illuminate/Translation/Translator.php b/src/Illuminate/Translation/Translator.php index ae0741442041..e29ba93a2dca 100755 --- a/src/Illuminate/Translation/Translator.php +++ b/src/Illuminate/Translation/Translator.php @@ -101,7 +101,18 @@ public function hasForLocale($key, $locale = null) */ public function has($key, $locale = null, $fallback = true) { - return $this->get($key, [], $locale, $fallback) !== $key; + $locale = $locale ?: $this->locale; + + $line = $this->get($key, [], $locale, $fallback); + + // For JSON translations, the loaded files will contain the correct line. + // Otherwise, we must assume we are handling typical translation file + // and check if the returned line is not the same as the given key. + if (! is_null($this->loaded['*']['*'][$locale][$key] ?? null)) { + return true; + } + + return $line !== $key; } /** diff --git a/tests/Integration/Translation/TranslatorTest.php b/tests/Integration/Translation/TranslatorTest.php new file mode 100644 index 000000000000..bb84bb5c17f9 --- /dev/null +++ b/tests/Integration/Translation/TranslatorTest.php @@ -0,0 +1,43 @@ +addJsonPath(__DIR__.'/lang'); + + parent::defineEnvironment($app); + } + + public function testItCanGetFromLocaleForJson() + { + $this->assertSame('30 Days', $this->app['translator']->get('30 Days')); + + $this->app->setLocale('fr'); + + $this->assertSame('30 jours', $this->app['translator']->get('30 Days')); + } + + public function testItCanCheckLanguageExistsHasFromLocaleForJson() + { + $this->assertTrue($this->app['translator']->has('1 Day')); + $this->assertTrue($this->app['translator']->hasForLocale('1 Day')); + $this->assertTrue($this->app['translator']->hasForLocale('30 Days')); + + $this->app->setLocale('fr'); + + $this->assertFalse($this->app['translator']->has('1 Day')); + $this->assertFalse($this->app['translator']->hasForLocale('1 Day')); + $this->assertTrue($this->app['translator']->hasForLocale('30 Days')); + } +} diff --git a/tests/Integration/Translation/lang/en.json b/tests/Integration/Translation/lang/en.json new file mode 100644 index 000000000000..5fe21d7ec1c6 --- /dev/null +++ b/tests/Integration/Translation/lang/en.json @@ -0,0 +1,7 @@ +{ + "1 Day": "1 Day", + "30 Days": "30 Days", + "365 Days": "365 Days", + "60 Days": "60 Days", + "90 Days": "90 Days" +} diff --git a/tests/Integration/Translation/lang/fr.json b/tests/Integration/Translation/lang/fr.json new file mode 100644 index 000000000000..ce824833b359 --- /dev/null +++ b/tests/Integration/Translation/lang/fr.json @@ -0,0 +1,6 @@ +{ + "30 Days": "30 jours", + "365 Days": "365 jours", + "60 Days": "60 jours", + "90 Days": "90 jours" +} From 858add225ce88a76c43aec0e7866288321ee0ee9 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 27 Jun 2023 08:25:54 -0500 Subject: [PATCH 20/24] version --- src/Illuminate/Foundation/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 9277e0cf36dd..d4748474157e 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -38,7 +38,7 @@ class Application extends Container implements ApplicationContract, CachesConfig * * @var string */ - const VERSION = '9.52.9'; + const VERSION = '9.52.10'; /** * The base path for the Laravel installation. From 285cdd86a4beb433513b38f41a89b510e0724a3e Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 27 Jun 2023 08:26:12 -0500 Subject: [PATCH 21/24] version --- src/Illuminate/Foundation/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 09b3387da238..715abd9b7b03 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -38,7 +38,7 @@ class Application extends Container implements ApplicationContract, CachesConfig * * @var string */ - const VERSION = '10.13.5'; + const VERSION = '10.14.0'; /** * The base path for the Laravel installation. From c4d014e3669c18f79f1f839971dbc0cda2007bdb Mon Sep 17 00:00:00 2001 From: taylorotwell Date: Tue, 27 Jun 2023 13:30:39 +0000 Subject: [PATCH 22/24] Update CHANGELOG --- CHANGELOG.md | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d9e08c2a461..9038658c3dd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,54 @@ # Release Notes for 10.x -## [Unreleased](https://github.com/laravel/framework/compare/v10.13.5...10.x) +## [Unreleased](https://github.com/laravel/framework/compare/v10.14.0...10.x) + +## [v10.14.0](https://github.com/laravel/framework/compare/v10.13.5...v10.14.0) - 2023-06-27 + +- [10.x] Add test for `withCookies` method in RedirectResponse by @milwad-dev in https://github.com/laravel/framework/pull/47383 +- [10.x] Add new error message "SSL: Handshake timed out" handling to PDO Deteā€¦ by @yehorherasymchuk in https://github.com/laravel/framework/pull/47392 +- [10.x] Add new error messages for detecting lost connections by @mfn in https://github.com/laravel/framework/pull/47398 +- [10.x] Update phpdoc `except` method in Middleware by @milwad-dev in https://github.com/laravel/framework/pull/47408 +- [10.x] Fix inconsistent type hint for `$passwordTimeoutSeconds` by @devfrey in https://github.com/laravel/framework/pull/47414 +- Change visibility of `path` method in FileStore.php by @foremtehan in https://github.com/laravel/framework/pull/47413 +- [10.x] Fix return type of `buildException` method by @milwad-dev in https://github.com/laravel/framework/pull/47422 +- [10.x] Allow serialization of NotificationSent by @cosmastech in https://github.com/laravel/framework/pull/47375 +- [10.x] Incorrect comment in `PredisConnector` and `PhpRedisConnector` by @hungthai1401 in https://github.com/laravel/framework/pull/47438 +- [10.x] Can set custom Response for denial within `Gate@inspect()` by @cosmastech in https://github.com/laravel/framework/pull/47436 +- [10.x] Remove unnecessary param in `addSingletonUpdate` by @milwad-dev in https://github.com/laravel/framework/pull/47446 +- [10.x] Fix return type of `prefixedResource` & `prefixedResource` by @milwad-dev in https://github.com/laravel/framework/pull/47445 +- [10.x] Add Factory::getNamespace() by @tylernathanreed in https://github.com/laravel/framework/pull/47463 +- [10.x] Add `whenAggregated` method to `ConditionallyLoadsAttributes` trait by @akr4m in https://github.com/laravel/framework/pull/47417 +- [10.x] Add PendingRequest `withHeader()` method by @ralphjsmit in https://github.com/laravel/framework/pull/47474 +- [10.x] Fix $exceptTables to allow an array of table names by @cwilby in https://github.com/laravel/framework/pull/47477 +- [10.x] Fix `eachById` on `HasManyThrough` relation by @cristiancalara in https://github.com/laravel/framework/pull/47479 +- [10.x] Allow object caching to be disabled for custom class casters by @CalebDW in https://github.com/laravel/framework/pull/47423 +- [10.x] "Can" validation rule by @stevebauman in https://github.com/laravel/framework/pull/47371 +- [10.x] refactor(Parser.php): Removing the extra "else" statement by @saMahmoudzadeh in https://github.com/laravel/framework/pull/47483 +- [10.x] Add `UncompromisedVerifier::class` to `provides()` in `ValidationServiceProvider` by @xurshudyan in https://github.com/laravel/framework/pull/47500 +- [9.x] Fix SES V2 Transport "reply to" addresses by @jacobmllr95 in https://github.com/laravel/framework/pull/47522 +- [10.x] Reindex appends attributes by @hungthai1401 in https://github.com/laravel/framework/pull/47519 +- [10.x] Fix `ListenerMakeCommand` deprecations by @dammy001 in https://github.com/laravel/framework/pull/47517 +- [10.x] Add `HandlesPotentiallyTranslatedString` trait by @xurshudyan in https://github.com/laravel/framework/pull/47488 +- [10.x] update [JsonResponse]: using match expression instead of if-elseif-else by @saMahmoudzadeh in https://github.com/laravel/framework/pull/47524 +- [10.x] Add `withQueryParameters` to the HTTP client by @mnapoli in https://github.com/laravel/framework/pull/47297 +- [10.x] Allow `%` symbol in component attribute names by @JayBizzle in https://github.com/laravel/framework/pull/47533 +- [10.x] Fix Http client pool return type by @srdante in https://github.com/laravel/framework/pull/47530 +- [10.x] Use `match` expression in `resolveSynchronousFake` by @osbre in https://github.com/laravel/framework/pull/47540 +- [10.x] Use `match` expression in `compileHaving` by @osbre in https://github.com/laravel/framework/pull/47548 +- [10.x] Use `match` expression in `getArrayableItems` by @osbre in https://github.com/laravel/framework/pull/47549 +- [10.x] Fix return type in `SessionGuard` by @PerryvanderMeer in https://github.com/laravel/framework/pull/47553 +- [10.x] Fix return type in `DatabaseQueue` by @PerryvanderMeer in https://github.com/laravel/framework/pull/47552 +- [10.x] Fix return type in `DumpCommand` by @PerryvanderMeer in https://github.com/laravel/framework/pull/47556 +- [10.x] Fix return type in `MigrateMakeCommand` by @PerryvanderMeer in https://github.com/laravel/framework/pull/47557 +- [10.x] Add missing return to `Factory` by @PerryvanderMeer in https://github.com/laravel/framework/pull/47559 +- [10.x] Update doc in Eloquent model by @alirezasalehizadeh in https://github.com/laravel/framework/pull/47562 +- [10.x] Fix return types by @PerryvanderMeer in https://github.com/laravel/framework/pull/47561 +- [10.x] Fix PHPDoc throw type by @fernandokbs in https://github.com/laravel/framework/pull/47566 +- [10.x] Add hasAny function to ComponentAttributeBag, Allow multiple keys in has function by @indykoning in https://github.com/laravel/framework/pull/47569 +- [10.x] Ensure captured time is in configured timezone by @timacdonald in https://github.com/laravel/framework/pull/47567 +- [10.x] Add Method to Report only logged exceptions by @joelharkes in https://github.com/laravel/framework/pull/47554 +- [10.x] Add global middleware to `Http` client by @timacdonald in https://github.com/laravel/framework/pull/47525 +- [9.x] Fixes unable to use `trans()->has()` on JSON language files. by @crynobone in https://github.com/laravel/framework/pull/47582 ## [v10.13.5](https://github.com/laravel/framework/compare/v10.13.3...v10.13.5) - 2023-06-08 @@ -9,6 +57,7 @@ ## [v10.13.3](https://github.com/laravel/framework/compare/v10.13.2...v10.13.3) - 2023-06-08 ### What's Changed + - Narrow down array type for `$attributes` in `CastsAttributes` by @devfrey in https://github.com/laravel/framework/pull/47365 - Add test for `assertViewHasAll` method by @milwad-dev in https://github.com/laravel/framework/pull/47366 - Fix `schedule:list` to display named Jobs by @liamkeily in https://github.com/laravel/framework/pull/47367 @@ -21,36 +70,44 @@ ## [v10.13.2 (2023-06-05)](https://github.com/laravel/framework/compare/v10.13.1...v10.13.2) ### Added + - Added `Illuminate/Http/Client/PendingRequest::replaceHeaders()` ([#47335](https://github.com/laravel/framework/pull/47335)) - Added `Illuminate/Notifications/Messages/MailMessage::attachMany()` ([#47345](https://github.com/laravel/framework/pull/47345)) ### Reverted + - Revert "[10.x] Remove session on authenticatable deletion v2" ([#47354](https://github.com/laravel/framework/pull/47354)) ### Fixed + - Fixes usage of Redis::many() with empty array ([#47307](https://github.com/laravel/framework/pull/47307)) - Fix mapped renderable exception handling ([#47347](https://github.com/laravel/framework/pull/47347)) - Avoid duplicates in fillable/guarded on merge in Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php ([#47351](https://github.com/laravel/framework/pull/47351)) ### Changed + - Update Kernel::load() to use same classFromFile logic as events ([#47327](https://github.com/laravel/framework/pull/47327)) - Remove redundant 'setAccessible' methods ([#47348](https://github.com/laravel/framework/pull/47348)) ## [v10.13.1 (2023-06-02)](https://github.com/laravel/framework/compare/v10.13.0...v10.13.1) ### Added + - Added `Illuminate\Contracts\Database\Query\ConditionExpression` interface and functional for this ([#47210](https://github.com/laravel/framework/pull/47210)) - Added return type for `Illuminate/Notifications/Channels/MailChannel::send()` ([#47310](https://github.com/laravel/framework/pull/47310)) ### Reverted + - Revert "[10.x] Fix inconsistentcy between report and render methods" ([#47326](https://github.com/laravel/framework/pull/47326)) ### Changed + - Display queue runtime in human readable format ([#47227](https://github.com/laravel/framework/pull/47227)) ## [v10.13.0 (2023-05-30)](https://github.com/laravel/framework/compare/v10.12.0...v10.13.0) ### Added + - Added `Illuminate/Hashing/HashManager::isHashed()` ([#47197](https://github.com/laravel/framework/pull/47197)) - Escaping functionality within the Grammar ([#46558](https://github.com/laravel/framework/pull/46558)) - Provide testing hooks in `Illuminate/Support/Sleep.php` ([#47228](https://github.com/laravel/framework/pull/47228)) @@ -58,6 +115,7 @@ - Wrap response preparation in events ([#47229](https://github.com/laravel/framework/pull/47229)) ### Fixed + - Fixed bug when function wrapped around definition of related factory ([#47168](https://github.com/laravel/framework/pull/47168)) - Fixed inconsistentcy between report and render methods ([#47201](https://github.com/laravel/framework/pull/47201)) - Fixes Model::isDirty() when AsCollection or AsEncryptedCollection have arguments ([#47235](https://github.com/laravel/framework/pull/47235)) @@ -65,6 +123,7 @@ - Fixes missing output on ProcessFailedException exception ([#47285](https://github.com/laravel/framework/pull/47285)) ### Changed + - Remove useless else statements ([#47186](https://github.com/laravel/framework/pull/47186)) - RedisStore improvement - don't open transaction unless all values are serialaizable ([#47193](https://github.com/laravel/framework/pull/47193)) - Use carbon::now() to get current timestamp in takeUntilTimeout lazycollection-method ([#47200](https://github.com/laravel/framework/pull/47200)) @@ -75,6 +134,7 @@ ## [v10.12.0 (2023-05-23)](https://github.com/laravel/framework/compare/v10.11.0...v10.12.0) ### Added + - Added `Illuminate/Queue/Events/JobTimedOut.php` ([#47068](https://github.com/laravel/framework/pull/47068)) - Added `when()` and `unless()` methods to `Illuminate/Support/Sleep` ([#47114](https://github.com/laravel/framework/pull/47114)) - Adds inline attachments support for markdown mailables ([#47140](https://github.com/laravel/framework/pull/47140)) @@ -83,19 +143,23 @@ - Added parameters to timezone validation rule ([#47171](https://github.com/laravel/framework/pull/47171)) ### Fixed + - Fixes singleton and api singletons creatable|destryoable|only|except combinations ([#47098](https://github.com/laravel/framework/pull/47098)) - Don't use empty key or secret for DynamoDBClient ([#47144](https://github.com/laravel/framework/pull/47144)) ### Changed + - Remove session on authenticatable deletion ([#47141](https://github.com/laravel/framework/pull/47141)) - Added error handling and ensure re-enabling of foreign key constraints in `Illuminate/Database/Schema/Builder::withoutForeignKeyConstraints()` ([#47182](https://github.com/laravel/framework/pull/47182)) ### Refactoring + - Remove useless else statements ([#47161](https://github.com/laravel/framework/pull/47161)) ## [v10.11.0 (2023-05-16)](https://github.com/laravel/framework/compare/v10.10.1...v10.11.0) ### Added + - Added the ability to extend the generic types for DatabaseNotificationCollection ([#47048](https://github.com/laravel/framework/pull/47048)) - Added `/Illuminate/Support/Carbon::createFromId()` ([#47046](https://github.com/laravel/framework/pull/47046)) - Added Name attributes on slots ([#47065](https://github.com/laravel/framework/pull/47065)) @@ -103,9 +167,11 @@ - Added Macroable trait to Sleep class ([#47099](https://github.com/laravel/framework/pull/47099)) ### Fixed + - Fixed `Illuminate/Database/Console/ShowModelCommand::getPolicy()` ([#47043](https://github.com/laravel/framework/pull/47043)) ### Changed + - Remove return from channelRoutes method ([#47059](https://github.com/laravel/framework/pull/47059)) - Bug in `Illuminate/Database/Migrations/Migrator::reset()` with string path ([#47047](https://github.com/laravel/framework/pull/47047)) - Unify logic around cursor paginate ([#47094](https://github.com/laravel/framework/pull/47094)) @@ -115,16 +181,19 @@ ## [v10.10.1 (2023-05-11)](https://github.com/laravel/framework/compare/v10.10.0...v10.10.1) ### Added + - Added `/Illuminate/Collections/Arr::mapWithKeys()` ([#47000](https://github.com/laravel/framework/pull/47000)) - Added `dd` and `dump` methods to `Illuminate/Support/Carbon.php` ([#47002](https://github.com/laravel/framework/pull/47002)) - Added `Illuminate/Queue/Failed/FileFailedJobProvider` ([#47007](https://github.com/laravel/framework/pull/47007)) - Added arguments to the signed middleware to ignore properties ([#46987](https://github.com/laravel/framework/pull/46987)) ### Fixed + - Added keys length check to prevent mget error in `Illuminate/Cache/RedisStore::many()` ([#46998](https://github.com/laravel/framework/pull/46998)) - 'hashed' cast - do not rehash already hashed value ([#47029](https://github.com/laravel/framework/pull/47029)) ### Changed + - Used `Carbon::now()` instead of `now()` ([#47017](https://github.com/laravel/framework/pull/47017)) - Use file locks when writing failed jobs to disk ([b822d28](https://github.com/laravel/framework/commit/b822d2810d29ab1aedf667abc76ed969d28bbaf5)) - Raise visibility of Mailable prepareMailableForDelivery() ([#47031](https://github.com/laravel/framework/pull/47031)) @@ -132,6 +201,7 @@ ## [v10.10.0 (2023-05-09)](https://github.com/laravel/framework/compare/v10.9.0...v10.10.0) ### Added + - Added `$isolated` and `isolatedExitCode` properties to `Illuminate/Console/Command` ([#46925](https://github.com/laravel/framework/pull/46925)) - Added ability to restore/set Global Scopes ([#46922](https://github.com/laravel/framework/pull/46922)) - Added `Illuminate/Collections/Arr::sortRecursiveDesc()` ([#46945](https://github.com/laravel/framework/pull/46945)) @@ -140,11 +210,13 @@ - Added url support for mail config ([#46964](https://github.com/laravel/framework/pull/46964)) ### Fixed + - Fixed replace missing_unless ([89ac58a](https://github.com/laravel/framework/commit/89ac58aa9b4fb7ef9f3b2290921488da1454ed30)) - Gracefully handle invalid code points in e() ([#46914](https://github.com/laravel/framework/pull/46914)) - HasCasts returning false instead of true ([#46992](https://github.com/laravel/framework/pull/46992)) ### Changed + - Use method on UploadedFile to validate image dimensions ([#46912](https://github.com/laravel/framework/pull/46912)) - Expose Js::json() helper ([#46935](https://github.com/laravel/framework/pull/46935)) - Respect parents on middleware priority ([#46972](https://github.com/laravel/framework/pull/46972)) @@ -154,15 +226,18 @@ ## [v10.9.0 (2023-04-25)](https://github.com/laravel/framework/compare/v10.8.0...v10.9.0) ### Added + - Add new HTTP status assertions ([#46841](https://github.com/laravel/framework/pull/46841)) - Allow pruning all cancelled and unfinished queue batches ([#46833](https://github.com/laravel/framework/pull/46833)) - Added `IGNITION_LOCAL_SITES_PATH` to `$passthroughVariables` in `ServeCommand.php` ([#46857](https://github.com/laravel/framework/pull/46857)) - Added named static methods for middleware ([#46362](https://github.com/laravel/framework/pull/46362)) ### Fixed + - Fix date_format rule throw ValueError ([#46824](https://github.com/laravel/framework/pull/46824)) ### Changed + - Allow separate directory for locks on filestore ([#46811](https://github.com/laravel/framework/pull/46811)) - Allow to whereMorphedTo work with null model ([#46821](https://github.com/laravel/framework/pull/46821)) - Use pivot model fromDateTime instead of assuming Carbon in `Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable::addTimestampsToAttachment()` ([#46822](https://github.com/laravel/framework/pull/46822)) @@ -174,6 +249,7 @@ ## [v10.8.0 (2023-04-18)](https://github.com/laravel/framework/compare/v10.7.1...v10.8.0) ### Added + - Added syntax sugar to the Process::pipe method ([#46745](https://github.com/laravel/framework/pull/46745)) - Allow specifying index name when calling ForeignIdColumnDefinition@constrained() ([#46746](https://github.com/laravel/framework/pull/46746)) - Allow to customise redirect URL in AuthenticateSession Middleware ([#46752](https://github.com/laravel/framework/pull/46752)) @@ -181,11 +257,13 @@ - Added max exceptions to broadcast event ([#46800](https://github.com/laravel/framework/pull/46800)) ### Fixed + - Fixed compiled view file ends with .php ([#46755](https://github.com/laravel/framework/pull/46755)) - Fix validation rule names ([#46768](https://github.com/laravel/framework/pull/46768)) - Fixed validateDecimal() ([#46809](https://github.com/laravel/framework/pull/46809)) ### Changed + - Add headers to exception in `Illuminate/Foundation/Application::abourd()` ([#46780](https://github.com/laravel/framework/pull/46780)) - Minor skeleton slimming (framework edition) ([#46786](https://github.com/laravel/framework/pull/46786)) - Release lock for job implementing ShouldBeUnique that is dispatched afterResponse() ([#46806](https://github.com/laravel/framework/pull/46806)) @@ -193,17 +271,20 @@ ## [v10.7.1 (2023-04-11)](https://github.com/laravel/framework/compare/v10.7.0...v10.7.1) ### Changed + - Changed `Illuminate/Process/Factory::pipe()` method. It will be run pipes immediately ([e34ab39](https://github.com/laravel/framework/commit/e34ab392800bfc175334c90e9321caa7261c2d65)) ## [v10.7.0 (2023-04-11)](https://github.com/laravel/framework/compare/v10.6.2...v10.7.0) ### Added + - Allow `Illuminate/Foundation/Testing/WithFaker` to be used when app is not bound ([#46529](https://github.com/laravel/framework/pull/46529)) - Allow Event::assertListening to check for invokable event listeners ([#46683](https://github.com/laravel/framework/pull/46683)) - Added `Illuminate/Process/Factory::pipe()` ([#46527](https://github.com/laravel/framework/pull/46527)) - Added `Illuminate/Validation/Validator::setValue` ([#46716](https://github.com/laravel/framework/pull/46716)) ### Fixed + - PHP 8.0 fix for Closure jobs ([#46505](https://github.com/laravel/framework/pull/46505)) - Fix preg_split error when there is a slash in the attribute in `Illuminate/Validation/ValidationData` ([#46549](https://github.com/laravel/framework/pull/46549)) - Fixed Cache::spy incompatibility with Cache::get ([#46689](https://github.com/laravel/framework/pull/46689)) @@ -212,29 +293,35 @@ - Fix query builder whereBetween method with carbon date period ([#46720](https://github.com/laravel/framework/pull/46720)) ### Changed + - Removes unnecessary parameters in `creatable()` / `destroyable()` methods in `Illuminate/Routing/PendingSingletonResourceRegistration` ([#46677](https://github.com/laravel/framework/pull/46677)) - Return non-zero exit code for uncaught exceptions ([#46541](https://github.com/laravel/framework/pull/46541)) ## [v10.6.2 (2023-04-05)](https://github.com/laravel/framework/compare/v10.6.1...v10.6.2) ### Added + - Added trait `Illuminate/Foundation/Testing/WithConsoleEvents` ([#46694](https://github.com/laravel/framework/pull/46694)) ### Changed + - Added missing ignored methods to `Illuminate/View/Component` ([#46692](https://github.com/laravel/framework/pull/46692)) - console.stub: remove void return type from handle ([#46697](https://github.com/laravel/framework/pull/46697)) ## [v10.6.1 (2023-04-04)](https://github.com/laravel/framework/compare/v10.6.0...v10.6.1) ### Reverted + - Reverted ["Set container instance on session manager"Set container instance on session manager](https://github.com/laravel/framework/pull/46621) ([#46691](https://github.com/laravel/framework/pull/46691)) ## [v10.6.0 (2023-04-04)](https://github.com/laravel/framework/compare/v10.5.1...v10.6.0) ### Added + - Added ability to set a custom class for the AsCollection and AsEncryptedCollection casts ([#46619](https://github.com/laravel/framework/pull/46619)) ### Changed + - Set container instance on session manager ([#46621](https://github.com/laravel/framework/pull/46621)) - Added empty string definition to Str::squish function ([#46660](https://github.com/laravel/framework/pull/46660)) - Allow $sleepMilliseconds parameter receive a Closure in retry method from PendingRequest ([#46653](https://github.com/laravel/framework/pull/46653)) @@ -243,26 +330,31 @@ ## [v10.5.1 (2023-03-29)](https://github.com/laravel/framework/compare/v10.5.0...v10.5.1) ### Added + - Added methods to determine if API resource has pivot loaded ([#46555](https://github.com/laravel/framework/pull/46555)) - Added caseSensitive flag to Stringable replace function ([#46578](https://github.com/laravel/framework/pull/46578)) - Allow insert..select (insertUsing()) to have empty $columns ([#46605](https://github.com/laravel/framework/pull/46605), [399bff9](https://github.com/laravel/framework/commit/399bff9331252e64a3439ea43e05f87f901dad55)) - Added `Illuminate/Database/Connection::selectResultSets()` ([#46592](https://github.com/laravel/framework/pull/46592)) ### Changed + - Make sure pivot model has previously defined values ([#46559](https://github.com/laravel/framework/pull/46559)) - Move SetUniqueIds to run before the creating event ([#46622](https://github.com/laravel/framework/pull/46622)) ## [v10.5.0 (2023-03-28)](https://github.com/laravel/framework/compare/v10.4.1...v10.5.0) ### Added + - Added `Illuminate/Cache/CacheManager::setApplication()` ([#46594](https://github.com/laravel/framework/pull/46594)) ### Fixed + - Fix infinite loading on batches list on Horizon ([#46536](https://github.com/laravel/framework/pull/46536)) - Fix whereNull queries with raw expressions for the MySql grammar ([#46538](https://github.com/laravel/framework/pull/46538)) - Fix getDirty method when using AsEnumArrayObject / AsEnumCollection ([#46561](https://github.com/laravel/framework/pull/46561)) ### Changed + - Skip `Illuminate/Support/Reflector::isParameterBackedEnumWithStringBackingType` for non ReflectionNamedType ([#46511](https://github.com/laravel/framework/pull/46511)) - Replace Deprecated DBAL Comparator creation with schema aware Comparator ([#46517](https://github.com/laravel/framework/pull/46517)) - Added Storage::json() method to read and decode a json file ([#46548](https://github.com/laravel/framework/pull/46548)) @@ -275,11 +367,13 @@ ## [v10.4.1 (2023-03-18)](https://github.com/laravel/framework/compare/v10.4.0...v10.4.1) ### Changed + - Move Symfony events dispatcher registration to Console\Kernel ([#46508](https://github.com/laravel/framework/pull/46508)) ## [v10.4.0 (2023-03-17)](https://github.com/laravel/framework/compare/v10.3.3...v10.4.0) ### Added + - Added `Illuminate/Testing/Concerns/AssertsStatusCodes::assertUnsupportedMediaType()` ([#46426](https://github.com/laravel/framework/pull/46426)) - Added curl_error_code: 77 to DetectsLostConnections ([#46429](https://github.com/laravel/framework/pull/46429)) - Allow for converting a HasMany to HasOne && MorphMany to MorphOne ([#46443](https://github.com/laravel/framework/pull/46443)) @@ -287,11 +381,13 @@ - Added `Illuminate/Filesystem/Filesystem::json()` ([#46481](https://github.com/laravel/framework/pull/46481)) ### Fixed + - Fix parsed input arguments for command events using dispatcher rerouting ([#46442](https://github.com/laravel/framework/pull/46442)) - Fix enums uses with optional implicit parameters ([#46483](https://github.com/laravel/framework/pull/46483)) - Fix deprecations for embedded images in symfony mailer ([#46488](https://github.com/laravel/framework/pull/46488)) ### Changed + - Added alternative database port in Postgres DSN ([#46403](https://github.com/laravel/framework/pull/46403)) - Allow calling getControllerClass on closure-based routes ([#46411](https://github.com/laravel/framework/pull/46411)) - Remove obsolete method_exists(ReflectionClass::class, 'isEnum') call ([#46445](https://github.com/laravel/framework/pull/46445)) @@ -301,24 +397,29 @@ ## [v10.3.3 (2023-03-09)](https://github.com/laravel/framework/compare/v10.3.2...v10.3.3) ### Reverted + - Reverted ["Allow override of the Builder paginate() total"](https://github.com/laravel/framework/pull/46336) ([#46406](https://github.com/laravel/framework/pull/46406)) ## [v10.3.2 (2023-03-08)](https://github.com/laravel/framework/compare/v10.3.1...v10.3.2) ### Reverted + - Reverted ["FIX on CanBeOneOfMany trait giving erroneous results"](https://github.com/laravel/framework/pull/46309) ([#46402](https://github.com/laravel/framework/pull/46402)) ### Fixed + - Fixes Expression no longer implements Stringable ([#46395](https://github.com/laravel/framework/pull/46395)) ## [v10.3.1 (2023-03-08)](https://github.com/laravel/framework/compare/v10.3.0...v10.3.1) ### Reverted + - Reverted ["Use fallback when previous URL is the same as the current in `Illuminate/Routing/UrlGenerator::previous()`"](https://github.com/laravel/framework/pull/46234) ([#46392](https://github.com/laravel/framework/pull/46392)) ## [v10.3.0 (2023-03-07)](https://github.com/laravel/framework/compare/v10.2.0...v10.3.0) ### Added + - Adding Pipeline Facade ([#46271](https://github.com/laravel/framework/pull/46271)) - Add Support for SaveQuietly and Upsert with UUID/ULID Primary Keys ([#46161](https://github.com/laravel/framework/pull/46161)) - Add charAt method to both Str and Stringable ([#46349](https://github.com/laravel/framework/pull/46349), [dfb59bc2](https://github.com/laravel/framework/commit/dfb59bc263a4e28ac8992deeabd2ccd9392d1681)) @@ -326,16 +427,19 @@ - Add processors to logging (placeholders) ([#46344](https://github.com/laravel/framework/pull/46344)) ### Fixed + - Fixed `Illuminate/Mail/Mailable::buildMarkdownView()` ([791f8ea7](https://github.com/laravel/framework/commit/791f8ea70b5872ae4483a32f6aeb28dd2ed4b8d7)) - FIX on CanBeOneOfMany trait giving erroneous results ([#46309](https://github.com/laravel/framework/pull/46309)) ### Changed + - Use fallback when previous URL is the same as the current in `Illuminate/Routing/UrlGenerator::previous()` ([#46234](https://github.com/laravel/framework/pull/46234)) - Allow override of the Builder paginate() total ([#46336](https://github.com/laravel/framework/pull/46336)) ## [v10.2.0 (2023-03-02)](https://github.com/laravel/framework/compare/v10.1.5...v10.2.0) ### Added + - Adding `Conditionable` train to Logger ([#46259](https://github.com/laravel/framework/pull/46259)) - Added "dot" method to Illuminate\Support\Collection class ([#46265](https://github.com/laravel/framework/pull/46265)) - Added a "channel:list" command ([#46248](https://github.com/laravel/framework/pull/46248)) @@ -344,12 +448,15 @@ - Add ArrayAccess to Stringable ([#46279](https://github.com/laravel/framework/pull/46279)) ### Reverted + - Revert "[10.x] Fix custom themes not reseting on Markdown renderer" ([#46328](https://github.com/laravel/framework/pull/46328)) ### Fixed + - Fix typo in function `createMissingSqliteDatbase` name in `src/Illuminate/Database/Console/Migrations/MigrateCommand.php` ([#46326](https://github.com/laravel/framework/pull/46326)) ### Changed + - Generate default command name based on class name in `ConsoleMakeCommand` ([#46256](https://github.com/laravel/framework/pull/46256)) - Do not mutate underlying values on redirect ([#46281](https://github.com/laravel/framework/pull/46281)) - Do not use null to initialise $lastExecutionStartedAt in `ScheduleWorkCommand` ([#46285](https://github.com/laravel/framework/pull/46285)) @@ -359,48 +466,59 @@ ## [v10.1.5 (2023-02-24)](https://github.com/laravel/framework/compare/v10.1.4...v10.1.5) ### Fixed + - Fixed `Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase::expectsDatabaseQueryCount()` $connection parameter ([#46228](https://github.com/laravel/framework/pull/46228)) - Fixed Facade Fake ([#46257](https://github.com/laravel/framework/pull/46257)) ### Changed + - Remove autoload dumping from make:migration ([#46215](https://github.com/laravel/framework/pull/46215)) ## [v10.1.4 (2023-02-23)](https://github.com/laravel/framework/compare/v10.1.3...v10.1.4) ### Changed + - Improve Facade Fake Awareness ([#46188](https://github.com/laravel/framework/pull/46188), [#46232](https://github.com/laravel/framework/pull/46232)) ## [v10.1.3 (2023-02-22)](https://github.com/laravel/framework/compare/v10.1.2...v10.1.3) ### Added + - Added protected method `Illuminate/Http/Resources/Json/JsonResource::newCollection()` for simplifies collection customisation ([#46217](https://github.com/laravel/framework/pull/46217)) ### Fixed + - Fixes constructable migrations ([#46223](https://github.com/laravel/framework/pull/46223)) ### Changes + - Accept time when generating ULID in `Str::ulid()` ([#46201](https://github.com/laravel/framework/pull/46201)) ## [v10.1.2 (2023-02-22)](https://github.com/laravel/framework/compare/v10.1.1...v10.1.2) ### Reverted + - Revert changes from `Arr::random()` ([cf3eb90](https://github.com/laravel/framework/commit/cf3eb90a6473444bb7a78d1a3af1e9312a62020d)) ## [v10.1.1 (2023-02-21)](https://github.com/laravel/framework/compare/v10.1.0...v10.1.1) ### Added + - Add the ability to re-resolve cache drivers ([#46203](https://github.com/laravel/framework/pull/46203)) ### Fixed + - Fixed `Illuminate/Collections/Arr::shuffle()` for empty array ([0c6cae0](https://github.com/laravel/framework/commit/0c6cae0ef647158b9554cad05ff39db7e7ad0d33)) ## [v10.1.0 (2023-02-21)](https://github.com/laravel/framework/compare/v10.0.3...v10.1.0) ### Fixed + - Fixing issue where 0 is discarded as a valid timestamp ([#46158](https://github.com/laravel/framework/pull/46158)) - Fix custom themes not reseting on Markdown renderer ([#46200](https://github.com/laravel/framework/pull/46200)) ### Changed + - Use secure randomness in Arr:random and Arr:shuffle ([#46105](https://github.com/laravel/framework/pull/46105)) - Use mixed return type on controller stubs ([#46166](https://github.com/laravel/framework/pull/46166)) - Use InteractsWithDictionary in Eloquent collection ([#46196](https://github.com/laravel/framework/pull/46196)) @@ -408,22 +526,27 @@ ## [v10.0.3 (2023-02-17)](https://github.com/laravel/framework/compare/v10.0.2...v10.0.3) ### Added + - Added missing expression support for pluck in Builder ([#46146](https://github.com/laravel/framework/pull/46146)) ## [v10.0.2 (2023-02-16)](https://github.com/laravel/framework/compare/v10.0.1...v10.0.2) ### Added + - Register policies automatically to the gate ([#46132](https://github.com/laravel/framework/pull/46132)) ## [v10.0.1 (2023-02-16)](https://github.com/laravel/framework/compare/v10.0.0...v10.0.1) ### Added + - Standard Input can be applied to PendingProcess ([#46119](https://github.com/laravel/framework/pull/46119)) ### Fixed + - Fix Expression string casting ([#46137](https://github.com/laravel/framework/pull/46137)) ### Changed + - Add AddQueuedCookiesToResponse to middlewarePriority so it is handled in the right place ([#46130](https://github.com/laravel/framework/pull/46130)) - Show queue connection in MonitorCommand ([#46122](https://github.com/laravel/framework/pull/46122)) From a12d0de5c6b6d61debafaaaf473611d4f4f95ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=ABl=20Hagestein?= <6616996+Neol3108@users.noreply.github.com> Date: Tue, 27 Jun 2023 16:35:49 +0200 Subject: [PATCH 23/24] Fix Dispatcher::until return type (#47585) --- src/Illuminate/Contracts/Events/Dispatcher.php | 2 +- src/Illuminate/Events/Dispatcher.php | 2 +- src/Illuminate/Events/NullDispatcher.php | 2 +- src/Illuminate/Support/Testing/Fakes/EventFake.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Contracts/Events/Dispatcher.php b/src/Illuminate/Contracts/Events/Dispatcher.php index 638610698e68..7f4096af051e 100644 --- a/src/Illuminate/Contracts/Events/Dispatcher.php +++ b/src/Illuminate/Contracts/Events/Dispatcher.php @@ -34,7 +34,7 @@ public function subscribe($subscriber); * * @param string|object $event * @param mixed $payload - * @return array|null + * @return mixed */ public function until($event, $payload = []); diff --git a/src/Illuminate/Events/Dispatcher.php b/src/Illuminate/Events/Dispatcher.php index 78cc112c77a9..6fda1ab33c84 100755 --- a/src/Illuminate/Events/Dispatcher.php +++ b/src/Illuminate/Events/Dispatcher.php @@ -215,7 +215,7 @@ protected function resolveSubscriber($subscriber) * * @param string|object $event * @param mixed $payload - * @return array|null + * @return mixed */ public function until($event, $payload = []) { diff --git a/src/Illuminate/Events/NullDispatcher.php b/src/Illuminate/Events/NullDispatcher.php index 3164fbb2a884..4b2d01119cc7 100644 --- a/src/Illuminate/Events/NullDispatcher.php +++ b/src/Illuminate/Events/NullDispatcher.php @@ -57,7 +57,7 @@ public function push($event, $payload = []) * * @param string|object $event * @param mixed $payload - * @return array|null + * @return mixed */ public function until($event, $payload = []) { diff --git a/src/Illuminate/Support/Testing/Fakes/EventFake.php b/src/Illuminate/Support/Testing/Fakes/EventFake.php index 09b89adf0fd7..7a32315ce5d5 100644 --- a/src/Illuminate/Support/Testing/Fakes/EventFake.php +++ b/src/Illuminate/Support/Testing/Fakes/EventFake.php @@ -377,7 +377,7 @@ public function forgetPushed() * * @param string|object $event * @param mixed $payload - * @return array|null + * @return mixed */ public function until($event, $payload = []) { From 33184ff379cc588cf2a8e33863d2f1d2ae62a252 Mon Sep 17 00:00:00 2001 From: taylorotwell Date: Tue, 27 Jun 2023 14:36:22 +0000 Subject: [PATCH 24/24] Update facade docblocks --- src/Illuminate/Support/Facades/Event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Support/Facades/Event.php b/src/Illuminate/Support/Facades/Event.php index b5d14f8fb9e4..b2784d096f41 100755 --- a/src/Illuminate/Support/Facades/Event.php +++ b/src/Illuminate/Support/Facades/Event.php @@ -12,7 +12,7 @@ * @method static void push(string $event, object|array $payload = []) * @method static void flush(string $event) * @method static void subscribe(object|string $subscriber) - * @method static array|null until(string|object $event, mixed $payload = []) + * @method static mixed until(string|object $event, mixed $payload = []) * @method static array|null dispatch(string|object $event, mixed $payload = [], bool $halt = false) * @method static array getListeners(string $eventName) * @method static \Closure makeListener(\Closure|string|array $listener, bool $wildcard = false)