Skip to content

Commit c72d8d4

Browse files
authored
Merge branch 'laravel:9.x' into 9.x
2 parents a31362b + f28d762 commit c72d8d4

File tree

140 files changed

+4830
-578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+4830
-578
lines changed

.github/workflows/databases.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push, pull_request]
44

55
jobs:
66
mysql_57:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-22.04
88

99
services:
1010
mysql:
@@ -47,7 +47,7 @@ jobs:
4747
DB_USERNAME: root
4848

4949
mysql_8:
50-
runs-on: ubuntu-20.04
50+
runs-on: ubuntu-22.04
5151

5252
services:
5353
mysql:
@@ -90,7 +90,7 @@ jobs:
9090
DB_USERNAME: root
9191

9292
mariadb:
93-
runs-on: ubuntu-20.04
93+
runs-on: ubuntu-22.04
9494

9595
services:
9696
mysql:
@@ -133,7 +133,7 @@ jobs:
133133
DB_USERNAME: root
134134

135135
pgsql:
136-
runs-on: ubuntu-20.04
136+
runs-on: ubuntu-22.04
137137

138138
services:
139139
postgresql:
@@ -201,7 +201,7 @@ jobs:
201201
uses: shivammathur/setup-php@v2
202202
with:
203203
php-version: 8.1
204-
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlsrv, pdo, pdo_sqlsrv
204+
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlsrv, pdo, pdo_sqlsrv, odbc, pdo_odbc
205205
tools: composer:v2
206206
coverage: none
207207

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
src:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-22.04
1212

1313
strategy:
1414
fail-fast: true

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
linux_tests:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-22.04
1212

1313
services:
1414
memcached:

.styleci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
php:
22
preset: laravel
33
version: 8.1
4+
finder:
5+
not-name:
6+
- bad-syntax-strategy.php
47
js:
58
finder:
69
not-name:

CHANGELOG.md

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,120 @@
11
# Release Notes for 9.x
22

3-
## [Unreleased](https://github.com/laravel/framework/compare/v9.22.1...9.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v9.26.1...9.x)
4+
5+
6+
## [v9.26.1](https://github.com/laravel/framework/compare/v9.26.0...v9.26.1) - 2022-08-23
7+
8+
### Revert
9+
- Revert "[9.x] Add statusText for an assertion message" ([#43831](https://github.com/laravel/framework/pull/43831))
10+
11+
### Fixed
12+
- Fixed `withoutVite` ([#43826](https://github.com/laravel/framework/pull/43826))
13+
14+
15+
## [v9.26.0](https://github.com/laravel/framework/compare/v9.25.1...v9.26.0) - 2022-08-23
16+
17+
### Added
18+
- Adding support for non-backed enums in Models ([#43728](https://github.com/laravel/framework/pull/43728))
19+
- Added vite asset url helpers ([#43702](https://github.com/laravel/framework/pull/43702))
20+
- Added Authentication keyword for SqlServerConnector.php ([#43757](https://github.com/laravel/framework/pull/43757))
21+
- Added support for additional where* methods to route groups ([#43731](https://github.com/laravel/framework/pull/43731))
22+
- Added min_digits and max_digits validation ([#43797](https://github.com/laravel/framework/pull/43797))
23+
- Added closure support to dispatch conditionals in bus ([#43784](https://github.com/laravel/framework/pull/43784))
24+
- Added configurable paths to Vite ([#43620](https://github.com/laravel/framework/pull/43620))
25+
26+
### Fixed
27+
- Fix unique lock release for broadcast events ([#43738](https://github.com/laravel/framework/pull/43738))
28+
- Fix empty collection class serialization ([#43758](https://github.com/laravel/framework/pull/43758))
29+
- Fixes creation of deprecations channel ([#43812](https://github.com/laravel/framework/pull/43812))
30+
31+
### Changed
32+
- Improve display of failures for assertDatabaseHas ([#43736](https://github.com/laravel/framework/pull/43736))
33+
- Always use the write PDO connection to read the just stored pending batch in bus ([#43737](https://github.com/laravel/framework/pull/43737))
34+
- Move unique lock release to method ([#43740](https://github.com/laravel/framework/pull/43740))
35+
- Remove timeoutAt fallback from Job base class ([#43749](https://github.com/laravel/framework/pull/43749))
36+
- Convert closures to arrow functions ([#43778](https://github.com/laravel/framework/pull/43778))
37+
- Use except also in `Illuminate/Routing/Middleware/ValidateSignature::handle()` ([e554d47](https://github.com/laravel/framework/commit/e554d471daab568877c039e955a01cb2f06a2e7b))
38+
- Adjust forever time for cookies ([#43806](https://github.com/laravel/framework/pull/43806))
39+
- Make string padding UTF-8 safe ([f1762ed](https://github.com/laravel/framework/commit/f1762ed1660f2a71189f1a32efe5b410ec428268))
40+
41+
42+
## [v9.25.1](https://github.com/laravel/framework/compare/v9.25.0...v9.25.1) - 2022-08-16
43+
44+
### Fixes
45+
- [Fixed typos](https://github.com/laravel/framework/compare/v9.25.0...v9.25.1)
46+
47+
48+
## [v9.25.0](https://github.com/laravel/framework/compare/v9.24.0...v9.25.0) - 2022-08-16
49+
50+
### Added
51+
- Added whenNotExactly to Stringable ([#43700](https://github.com/laravel/framework/pull/43700))
52+
- Added ability to Model::query()->touch() to mass update timestamps ([#43665](https://github.com/laravel/framework/pull/43665))
53+
54+
### Fixed
55+
- Prevent error in db/model commands when using unsupported columns ([#43635](https://github.com/laravel/framework/pull/43635))
56+
- Fixes ensureDependenciesExist runtime error ([#43626](https://github.com/laravel/framework/pull/43626))
57+
- Null value for auto-cast field caused deprication warning in php 8.1 ([#43706](https://github.com/laravel/framework/pull/43706))
58+
- db:table command properly handle table who doesn't exist ([#43669](https://github.com/laravel/framework/pull/43669))
59+
60+
### Changed
61+
- Handle assoc mode within db commands ([#43636](https://github.com/laravel/framework/pull/43636))
62+
- Allow chunkById on Arrays, as well as Models ([#43666](https://github.com/laravel/framework/pull/43666))
63+
- Allow for int value parameters to whereMonth() and whereDay() ([#43668](https://github.com/laravel/framework/pull/43668))
64+
- Cleaning up old if-else statement ([#43712](https://github.com/laravel/framework/pull/43712))
65+
- Ensure correct 'integrity' value is used for css assets ([#43714](https://github.com/laravel/framework/pull/43714))
66+
67+
68+
## [v9.24.0](https://github.com/laravel/framework/compare/v9.23.0...v9.24.0) - 2022-08-09
69+
70+
### Added
71+
- New db:show, db:table and db:monitor commands ([#43367](https://github.com/laravel/framework/pull/43367))
72+
- Added validation doesnt_end_with rule ([#43518](https://github.com/laravel/framework/pull/43518))
73+
- Added `Illuminate/Database/Eloquent/SoftDeletes::restoreQuietly()` ([#43550](https://github.com/laravel/framework/pull/43550))
74+
- Added mergeUnless to resource ConditionallyLoadsAttributes trait ([#43567](https://github.com/laravel/framework/pull/43567))
75+
- Added `Illuminate/Support/Testing/Fakes/NotificationFake::sentNotifications()` ([#43558](https://github.com/laravel/framework/pull/43558))
76+
- Added `implode` to `Passthru` in `Illuminate/Database/Eloquent/Builder.php` ([#43574](https://github.com/laravel/framework/pull/43574))
77+
- Make Config repository macroable ([#43598](https://github.com/laravel/framework/pull/43598))
78+
- Add whenNull to ConditionallyLoadsAtrribute trait ([#43600](https://github.com/laravel/framework/pull/43600))
79+
- Extract child route model relationship name into a method ([#43597](https://github.com/laravel/framework/pull/43597))
80+
81+
### Revert
82+
- Reverted [Added `whereIn` to `Illuminate/Routing/RouteRegistrar::allowedAttributes`](https://github.com/laravel/framework/pull/43509) ([#43523](https://github.com/laravel/framework/pull/43523))
83+
84+
### Fixed
85+
- Fix unique locking on broadcast events ([#43516](https://github.com/laravel/framework/pull/43516))
86+
- Fixes the issue of running docs command on windows ([#43566](https://github.com/laravel/framework/pull/43566), [#43585](https://github.com/laravel/framework/pull/43585))
87+
- Fixes output when running db:seed or using --seed in migrate commands ([#43593](https://github.com/laravel/framework/pull/43593))
88+
89+
### Changed
90+
- Gracefully fail when unable to locate expected binary on the system for artisan docs command ([#43521](https://github.com/laravel/framework/pull/43521))
91+
- Improve output for some Artisan commands ([#43547](https://github.com/laravel/framework/pull/43547))
92+
- Alternative database name in Postgres DSN, allow pgbouncer aliased databases to continue working on 9.x ([#43542](https://github.com/laravel/framework/pull/43542))
93+
- Allow @class() for component tags ([#43140](https://github.com/laravel/framework/pull/43140))
94+
- Attribute Cast Performance Improvements ([#43554](https://github.com/laravel/framework/pull/43554))
95+
- Queue worker daemon should also listen for SIGQUIT ([#43607](https://github.com/laravel/framework/pull/43607))
96+
- Keep original keys when using Collection->sortBy() with an array of sort operations ([#43609](https://github.com/laravel/framework/pull/43609))
97+
98+
99+
## [v9.23.0](https://github.com/laravel/framework/compare/v9.22.1...v9.23.0) - 2022-08-02
100+
101+
### Added
102+
- Added whereNot method to Fluent JSON testing matchers ([#43383](https://github.com/laravel/framework/pull/43383))
103+
- Added deleteQuietly method to Model and use arrow func for related methods ([#43447](https://github.com/laravel/framework/pull/43447))
104+
- Added conditionable trait to Filesystem adapters ([#43450](https://github.com/laravel/framework/pull/43450))
105+
- Introduce artisan docs command ([#43357](https://github.com/laravel/framework/pull/43357))
106+
- Added Support CSP nonce, SRI, and arbitrary attributes with Vite ([#43442](https://github.com/laravel/framework/pull/43442))
107+
- Support conditionables that get condition from target object ([#43449](https://github.com/laravel/framework/pull/43449))
108+
- Added `whereIn` to `Illuminate/Routing/RouteRegistrar::allowedAttributes` ([#43509](https://github.com/laravel/framework/pull/43509))
109+
110+
### Fixed
111+
- Prevent redis crash when large number of jobs are scheduled for a specific time ([#43310](https://github.com/laravel/framework/pull/43310))
112+
113+
### Changed
114+
- Make Command components Factory extensible ([#43439](https://github.com/laravel/framework/pull/43439))
115+
- Solve Blade component showing quote formatted for the console ([#43446](https://github.com/laravel/framework/pull/43446))
116+
- Improves output capture from serve command ([#43461](https://github.com/laravel/framework/pull/43461))
117+
- Allow terser singleton bindings ([#43469](https://github.com/laravel/framework/pull/43469))
4118

5119

6120
## [v9.22.1](https://github.com/laravel/framework/compare/v9.22.0...v9.22.1) - 2022-07-26

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"psr/log": "^1.0|^2.0|^3.0",
3333
"psr/simple-cache": "^1.0|^2.0|^3.0",
3434
"ramsey/uuid": "^4.2.2",
35-
"symfony/console": "^6.0",
35+
"symfony/console": "^6.0.3",
3636
"symfony/error-handler": "^6.0",
3737
"symfony/finder": "^6.0",
3838
"symfony/http-foundation": "^6.0",

src/Illuminate/Broadcasting/BroadcastManager.php

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
use Illuminate\Broadcasting\Broadcasters\NullBroadcaster;
1111
use Illuminate\Broadcasting\Broadcasters\PusherBroadcaster;
1212
use Illuminate\Broadcasting\Broadcasters\RedisBroadcaster;
13+
use Illuminate\Bus\UniqueLock;
1314
use Illuminate\Contracts\Broadcasting\Factory as FactoryContract;
1415
use Illuminate\Contracts\Broadcasting\ShouldBeUnique;
1516
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
1617
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcherContract;
18+
use Illuminate\Contracts\Cache\Repository as Cache;
1719
use Illuminate\Contracts\Foundation\CachesRoutes;
1820
use InvalidArgumentException;
1921
use Psr\Log\LoggerInterface;
@@ -166,12 +168,34 @@ public function queue($event)
166168
$queue = $event->queue;
167169
}
168170

169-
$this->app->make('queue')->connection($event->connection ?? null)->pushOn(
170-
$queue,
171-
$event instanceof ShouldBeUnique
172-
? new UniqueBroadcastEvent(clone $event)
173-
: new BroadcastEvent(clone $event)
174-
);
171+
$broadcastEvent = new BroadcastEvent(clone $event);
172+
173+
if ($event instanceof ShouldBeUnique) {
174+
$broadcastEvent = new UniqueBroadcastEvent(clone $event);
175+
176+
if ($this->mustBeUniqueAndCannotAcquireLock($broadcastEvent)) {
177+
return;
178+
}
179+
}
180+
181+
$this->app->make('queue')
182+
->connection($event->connection ?? null)
183+
->pushOn($queue, $broadcastEvent);
184+
}
185+
186+
/**
187+
* Determine if the broadcastable event must be unique and determine if we can acquire the necessary lock.
188+
*
189+
* @param mixed $event
190+
* @return bool
191+
*/
192+
protected function mustBeUniqueAndCannotAcquireLock($event)
193+
{
194+
return ! (new UniqueLock(
195+
method_exists($event, 'uniqueVia')
196+
? $event->uniqueVia()
197+
: $this->app->make(Cache::class)
198+
))->acquire($event);
175199
}
176200

177201
/**

src/Illuminate/Broadcasting/UniqueBroadcastEvent.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Illuminate\Broadcasting;
44

5+
use Illuminate\Container\Container;
6+
use Illuminate\Contracts\Cache\Repository;
57
use Illuminate\Contracts\Queue\ShouldBeUnique;
68

79
class UniqueBroadcastEvent extends BroadcastEvent implements ShouldBeUnique
@@ -21,14 +23,7 @@ class UniqueBroadcastEvent extends BroadcastEvent implements ShouldBeUnique
2123
public $uniqueFor;
2224

2325
/**
24-
* The cache repository implementation that should be used to obtain unique locks.
25-
*
26-
* @var \Illuminate\Contracts\Cache\Repository
27-
*/
28-
public $uniqueVia;
29-
30-
/**
31-
* Create a new job handler instance.
26+
* Create a new event instance.
3227
*
3328
* @param mixed $event
3429
* @return void
@@ -38,9 +33,9 @@ public function __construct($event)
3833
$this->uniqueId = get_class($event);
3934

4035
if (method_exists($event, 'uniqueId')) {
41-
$this->uniqueId = $event->uniqueId();
36+
$this->uniqueId .= $event->uniqueId();
4237
} elseif (property_exists($event, 'uniqueId')) {
43-
$this->uniqueId = $event->uniqueId;
38+
$this->uniqueId .= $event->uniqueId;
4439
}
4540

4641
if (method_exists($event, 'uniqueFor')) {
@@ -49,12 +44,18 @@ public function __construct($event)
4944
$this->uniqueFor = $event->uniqueFor;
5045
}
5146

52-
if (method_exists($event, 'uniqueVia')) {
53-
$this->uniqueVia = $event->uniqueVia();
54-
} elseif (property_exists($event, 'uniqueVia')) {
55-
$this->uniqueVia = $event->uniqueVia;
56-
}
57-
5847
parent::__construct($event);
5948
}
49+
50+
/**
51+
* Resolve the cache implementation that should manage the event's uniqueness.
52+
*
53+
* @return \Illuminate\Contracts\Cache\Repository
54+
*/
55+
public function uniqueVia()
56+
{
57+
return method_exists($this->event, 'uniqueVia')
58+
? $this->event->uniqueVia()
59+
: Container::getInstance()->make(Repository::class);
60+
}
6061
}

src/Illuminate/Broadcasting/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"psr/log": "^1.0|^2.0|^3.0",
2020
"illuminate/bus": "^9.0",
2121
"illuminate/collections": "^9.0",
22+
"illuminate/container": "^9.0",
2223
"illuminate/contracts": "^9.0",
2324
"illuminate/queue": "^9.0",
2425
"illuminate/support": "^9.0"

src/Illuminate/Bus/DatabaseBatchRepository.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public function get($limit = 50, $before = null)
7676
public function find(string $batchId)
7777
{
7878
$batch = $this->connection->table($this->table)
79+
->useWritePdo()
7980
->where('id', $batchId)
8081
->first();
8182

0 commit comments

Comments
 (0)