Skip to content

Commit 7765545

Browse files
authored
Merge branch 'laravel:9.x' into 9.x
2 parents fa69789 + 0fbbbf2 commit 7765545

File tree

95 files changed

+2722
-170
lines changed

Some content is hidden

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

95 files changed

+2722
-170
lines changed

.github/workflows/tests.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,8 @@ jobs:
3939
strategy:
4040
fail-fast: true
4141
matrix:
42-
php: ['8.0', 8.1]
42+
php: ['8.0', 8.1, 8.2]
4343
stability: [prefer-lowest, prefer-stable]
44-
include:
45-
- php: 8.2
46-
stability: prefer-stable --ignore-platform-req=php+
4744

4845
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
4946

@@ -79,6 +76,14 @@ jobs:
7976
command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 --no-interaction --no-update
8077
if: matrix.php >= 8.1
8178

79+
- name: Set Minimum PHP 8.2 Versions
80+
uses: nick-invision/retry@v1
81+
with:
82+
timeout_minutes: 5
83+
max_attempts: 5
84+
command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 --no-interaction --no-update
85+
if: matrix.php >= 8.2
86+
8287
- name: Install dependencies
8388
uses: nick-invision/retry@v1
8489
with:
@@ -110,11 +115,8 @@ jobs:
110115
strategy:
111116
fail-fast: true
112117
matrix:
113-
php: ['8.0', 8.1]
118+
php: ['8.0', 8.1, 8.2]
114119
stability: [prefer-lowest, prefer-stable]
115-
include:
116-
- php: 8.2
117-
stability: prefer-stable --ignore-platform-req=php+
118120

119121
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Windows
120122

@@ -140,9 +142,17 @@ jobs:
140142
with:
141143
timeout_minutes: 5
142144
max_attempts: 5
143-
command: composer require guzzlehttp/guzzle:^7.2 --no-interaction --no-update
145+
command: composer require guzzlehttp/guzzle:~7.2 --no-interaction --no-update
144146
if: matrix.php >= 8
145147

148+
- name: Set Minimum PHP 8.2 Versions
149+
uses: nick-invision/retry@v1
150+
with:
151+
timeout_minutes: 5
152+
max_attempts: 5
153+
command: composer require guzzlehttp/guzzle:~7.5 guzzlehttp/psr7:~2.4 predis/predis:^2.0.2 --no-interaction --no-update
154+
if: matrix.php >= 8.2
155+
146156
- name: Install dependencies
147157
uses: nick-invision/retry@v1
148158
with:

CHANGELOG.md

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

3-
## [Unreleased](https://github.com/laravel/framework/compare/v9.32.0...9.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v9.34.0...9.x)
4+
5+
6+
## [v9.34.0](https://github.com/laravel/framework/compare/v9.33.0...v9.34.0) - 2022-10-04
7+
8+
### Added
9+
- Short attribute syntax for Self Closing Blade Components ([#44413](https://github.com/laravel/framework/pull/44413))
10+
- Adds support for PHP's BackedEnum to be "rendered" on blade views ([#44445](https://github.com/laravel/framework/pull/44445))
11+
12+
### Fixed
13+
- Fixed Precognition headers for Symfony responses ([#44424](https://github.com/laravel/framework/pull/44424))
14+
- Allow to create databases with dots ([#44436](https://github.com/laravel/framework/pull/44436))
15+
- Fixes dd source on windows ([#44451](https://github.com/laravel/framework/pull/44451))
16+
17+
### Changed
18+
- Adds error output to db command when missing host ([#44394](https://github.com/laravel/framework/pull/44394))
19+
- Changed `Illuminate/Database/Schema/ForeignIdColumnDefinition::constrained()` ([#44425](https://github.com/laravel/framework/pull/44425))
20+
- Allow maintenance mode events to be listened to in closure based listeners ([#44417](https://github.com/laravel/framework/pull/44417))
21+
- Allow factories to recycle multiple models of a given typ ([#44328](https://github.com/laravel/framework/pull/44328))
22+
- Improves dd clickable link on multiple editors and docker environments ([#44406](https://github.com/laravel/framework/pull/44406))
23+
24+
25+
## [v9.33.0](https://github.com/laravel/framework/compare/v9.32.0...v9.33.0) - 2022-09-30
26+
27+
### Added
28+
- Added `Illuminate/Support/Testing/Fakes/MailFake::cc()` ([#44319](https://github.com/laravel/framework/pull/44319))
29+
- Added Ignore Case of Str::contains and Str::containsAll to Stringable contains and containsAll ([#44369](https://github.com/laravel/framework/pull/44369))
30+
- Added missing morphs methods for the ULID support ([#44364](https://github.com/laravel/framework/pull/44364))
31+
- Introduce Laravel Precognition ([#44339](https://github.com/laravel/framework/pull/44339))
32+
- Added `Illuminate/Routing/Route::flushController()` ([#44386](https://github.com/laravel/framework/pull/44386))
33+
34+
### Fixed
35+
- Fixes memory leak on PHPUnit's Annotations registry ([#44324](https://github.com/laravel/framework/pull/44324), [#44336](https://github.com/laravel/framework/pull/44336))
36+
- Fixed `Illuminate/Filesystem/FilesystemAdapter::url()` with config `prefix` ([#44330](https://github.com/laravel/framework/pull/44330))
37+
- Fixed the "Implicit conversion from float to int loses precision" error in Timebox Class ([#44357](https://github.com/laravel/framework/pull/44357))
38+
39+
### Changed
40+
- Improves dd source on compiled views ([#44347](https://github.com/laravel/framework/pull/44347))
41+
- Only prints source on dd calls from dump.php ([#44367](https://github.com/laravel/framework/pull/44367))
42+
- Ensures a Carbon version that supports PHP 8.2 ([#44374](https://github.com/laravel/framework/pull/44374))
443

544

645
## [v9.32.0](https://github.com/laravel/framework/compare/v9.31.0...v9.32.0) - 2022-09-27

composer.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@
1919
"ext-mbstring": "*",
2020
"ext-openssl": "*",
2121
"doctrine/inflector": "^2.0",
22-
"dragonmantank/cron-expression": "^3.1",
23-
"egulias/email-validator": "^3.1",
22+
"dragonmantank/cron-expression": "^3.3.2",
23+
"egulias/email-validator": "^3.2.1",
2424
"fruitcake/php-cors": "^1.2",
25-
"laravel/serializable-closure": "^1.0",
25+
"laravel/serializable-closure": "^1.2.2",
2626
"league/commonmark": "^2.2",
2727
"league/flysystem": "^3.0.16",
2828
"monolog/monolog": "^2.0",
29-
"nesbot/carbon": "^2.53.1",
29+
"nesbot/carbon": "^2.62.1",
3030
"nunomaduro/termwind": "^1.13",
3131
"psr/container": "^1.1.1|^2.0.1",
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.3",
35+
"symfony/console": "^6.0.9",
3636
"symfony/error-handler": "^6.0",
3737
"symfony/finder": "^6.0",
3838
"symfony/http-foundation": "^6.0",
@@ -43,7 +43,7 @@
4343
"symfony/routing": "^6.0",
4444
"symfony/uid": "^6.0",
4545
"symfony/var-dumper": "^6.0",
46-
"tijsverkoyen/css-to-inline-styles": "^2.2.2",
46+
"tijsverkoyen/css-to-inline-styles": "^2.2.5",
4747
"vlucas/phpdotenv": "^5.4.1",
4848
"voku/portable-ascii": "^2.0"
4949
},
@@ -83,21 +83,21 @@
8383
},
8484
"require-dev": {
8585
"ably/ably-php": "^1.0",
86-
"aws/aws-sdk-php": "^3.198.1",
86+
"aws/aws-sdk-php": "^3.235.5",
8787
"doctrine/dbal": "^2.13.3|^3.1.4",
8888
"fakerphp/faker": "^1.9.2",
89-
"guzzlehttp/guzzle": "^7.2",
89+
"guzzlehttp/guzzle": "^7.5",
9090
"league/flysystem-aws-s3-v3": "^3.0",
9191
"league/flysystem-ftp": "^3.0",
9292
"league/flysystem-path-prefixing": "^3.3",
9393
"league/flysystem-read-only": "^3.3",
9494
"league/flysystem-sftp-v3": "^3.0",
95-
"mockery/mockery": "^1.4.4",
95+
"mockery/mockery": "^1.5.1",
9696
"orchestra/testbench-core": "^7.8",
9797
"pda/pheanstalk": "^4.0",
9898
"phpstan/phpstan": "^1.4.7",
9999
"phpunit/phpunit": "^9.5.8",
100-
"predis/predis": "^1.1.9|^2.0",
100+
"predis/predis": "^1.1.9|^2.0.2",
101101
"symfony/cache": "^6.0"
102102
},
103103
"provide": {
@@ -145,23 +145,23 @@
145145
"ext-posix": "Required to use all features of the queue worker.",
146146
"ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).",
147147
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
148-
"aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.198.1).",
148+
"aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).",
149149
"brianium/paratest": "Required to run tests in parallel (^6.0).",
150150
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).",
151151
"fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
152152
"filp/whoops": "Required for friendly error pages in development (^2.14.3).",
153-
"guzzlehttp/guzzle": "Required to use the HTTP Client and the ping methods on schedules (^7.2).",
153+
"guzzlehttp/guzzle": "Required to use the HTTP Client and the ping methods on schedules (^7.5).",
154154
"laravel/tinker": "Required to use the tinker console command (^2.0).",
155155
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).",
156156
"league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).",
157157
"league/flysystem-path-prefixing": "Required to use the scoped driver (^3.3).",
158158
"league/flysystem-read-only": "Required to use read-only disks (^3.3)",
159159
"league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).",
160-
"mockery/mockery": "Required to use mocking (^1.4.4).",
160+
"mockery/mockery": "Required to use mocking (^1.5.1).",
161161
"nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",
162162
"pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).",
163163
"phpunit/phpunit": "Required to use assertions and run tests (^9.5.8).",
164-
"predis/predis": "Required to use the predis connector (^1.1.9|^2.0).",
164+
"predis/predis": "Required to use the predis connector (^1.1.9|^2.0.2).",
165165
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
166166
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).",
167167
"symfony/cache": "Required to PSR-6 cache bridge (^6.0).",

src/Illuminate/Collections/Traits/EnumeratesValues.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,12 +980,12 @@ protected function getArrayableItems($items)
980980
return $items->all();
981981
} elseif ($items instanceof Arrayable) {
982982
return $items->toArray();
983+
} elseif ($items instanceof Traversable) {
984+
return iterator_to_array($items);
983985
} elseif ($items instanceof Jsonable) {
984986
return json_decode($items->toJson(), true);
985987
} elseif ($items instanceof JsonSerializable) {
986988
return (array) $items->jsonSerialize();
987-
} elseif ($items instanceof Traversable) {
988-
return iterator_to_array($items);
989989
} elseif ($items instanceof UnitEnum) {
990990
return [$items];
991991
}

src/Illuminate/Console/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"illuminate/support": "^9.0",
2222
"illuminate/view": "^9.0",
2323
"nunomaduro/termwind": "^1.13",
24-
"symfony/console": "^6.0",
24+
"symfony/console": "^6.0.9",
2525
"symfony/process": "^6.0"
2626
},
2727
"autoload": {
@@ -35,8 +35,8 @@
3535
}
3636
},
3737
"suggest": {
38-
"dragonmantank/cron-expression": "Required to use scheduler (^3.1).",
39-
"guzzlehttp/guzzle": "Required to use the ping methods on schedules (^7.2).",
38+
"dragonmantank/cron-expression": "Required to use scheduler (^3.3.2).",
39+
"guzzlehttp/guzzle": "Required to use the ping methods on schedules (^7.5).",
4040
"illuminate/bus": "Required to use the scheduled job dispatcher (^9.0).",
4141
"illuminate/container": "Required to use the scheduler (^9.0).",
4242
"illuminate/filesystem": "Required to use the generator command (^9.0).",

src/Illuminate/Database/Console/DbCommand.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ public function handle()
3434
{
3535
$connection = $this->getConnection();
3636

37+
if (! isset($connection['host'])) {
38+
$this->components->error('No host specified for this database connection.');
39+
$this->line(' Use the <options=bold>[--read]</> and <options=bold>[--write]</> options to specify a read or write connection.');
40+
$this->newLine();
41+
42+
return Command::FAILURE;
43+
}
44+
3745
(new Process(
3846
array_merge([$this->getCommand($connection)], $this->commandArguments($connection)),
3947
null,

src/Illuminate/Database/Console/Migrations/MigrateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ protected function createMissingMysqlDatabase($connection)
212212

213213
$freshConnection = $this->migrator->resolveConnection($this->option('database'));
214214

215-
return tap($freshConnection->unprepared("CREATE DATABASE IF NOT EXISTS {$connection->getDatabaseName()}"), function () {
215+
return tap($freshConnection->unprepared("CREATE DATABASE IF NOT EXISTS `{$connection->getDatabaseName()}`"), function () {
216216
$this->laravel['db']->purge();
217217
});
218218
} finally {

src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Illuminate\Database\Eloquent\Casts\Attribute;
1818
use Illuminate\Database\Eloquent\InvalidCastException;
1919
use Illuminate\Database\Eloquent\JsonEncodingException;
20+
use Illuminate\Database\Eloquent\MissingAttributeException;
2021
use Illuminate\Database\Eloquent\Relations\Relation;
2122
use Illuminate\Database\LazyLoadingViolationException;
2223
use Illuminate\Support\Arr;
@@ -445,10 +446,31 @@ public function getAttribute($key)
445446
// since we don't want to treat any of those methods as relationships because
446447
// they are all intended as helper methods and none of these are relations.
447448
if (method_exists(self::class, $key)) {
448-
return;
449+
return $this->throwMissingAttributeExceptionIfApplicable($key);
450+
}
451+
452+
return $this->isRelation($key) || $this->relationLoaded($key)
453+
? $this->getRelationValue($key)
454+
: $this->throwMissingAttributeExceptionIfApplicable($key);
455+
}
456+
457+
/**
458+
* Either throw a missing attribute exception or return null depending on Eloquent's configuration.
459+
*
460+
* @param string $key
461+
* @return null
462+
*
463+
* @throws \Illuminate\Database\Eloquent\MissingAttributeException
464+
*/
465+
protected function throwMissingAttributeExceptionIfApplicable($key)
466+
{
467+
if ($this->exists &&
468+
! $this->wasRecentlyCreated &&
469+
static::preventsAccessingMissingAttributes()) {
470+
throw new MissingAttributeException($this, $key);
449471
}
450472

451-
return $this->getRelationValue($key);
473+
return null;
452474
}
453475

454476
/**

src/Illuminate/Database/Eloquent/Concerns/HasEvents.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function removeObservableEvents($observables)
147147
* Register a model event with the dispatcher.
148148
*
149149
* @param string $event
150-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
150+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
151151
* @return void
152152
*/
153153
protected static function registerModelEvent($event, $callback)
@@ -230,7 +230,7 @@ protected function filterModelEventResults($result)
230230
/**
231231
* Register a retrieved model event with the dispatcher.
232232
*
233-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
233+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
234234
* @return void
235235
*/
236236
public static function retrieved($callback)
@@ -241,7 +241,7 @@ public static function retrieved($callback)
241241
/**
242242
* Register a saving model event with the dispatcher.
243243
*
244-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
244+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
245245
* @return void
246246
*/
247247
public static function saving($callback)
@@ -252,7 +252,7 @@ public static function saving($callback)
252252
/**
253253
* Register a saved model event with the dispatcher.
254254
*
255-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
255+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
256256
* @return void
257257
*/
258258
public static function saved($callback)
@@ -263,7 +263,7 @@ public static function saved($callback)
263263
/**
264264
* Register an updating model event with the dispatcher.
265265
*
266-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
266+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
267267
* @return void
268268
*/
269269
public static function updating($callback)
@@ -274,7 +274,7 @@ public static function updating($callback)
274274
/**
275275
* Register an updated model event with the dispatcher.
276276
*
277-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
277+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
278278
* @return void
279279
*/
280280
public static function updated($callback)
@@ -285,7 +285,7 @@ public static function updated($callback)
285285
/**
286286
* Register a creating model event with the dispatcher.
287287
*
288-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
288+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
289289
* @return void
290290
*/
291291
public static function creating($callback)
@@ -296,7 +296,7 @@ public static function creating($callback)
296296
/**
297297
* Register a created model event with the dispatcher.
298298
*
299-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
299+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
300300
* @return void
301301
*/
302302
public static function created($callback)
@@ -307,7 +307,7 @@ public static function created($callback)
307307
/**
308308
* Register a replicating model event with the dispatcher.
309309
*
310-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
310+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
311311
* @return void
312312
*/
313313
public static function replicating($callback)
@@ -318,7 +318,7 @@ public static function replicating($callback)
318318
/**
319319
* Register a deleting model event with the dispatcher.
320320
*
321-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
321+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
322322
* @return void
323323
*/
324324
public static function deleting($callback)
@@ -329,7 +329,7 @@ public static function deleting($callback)
329329
/**
330330
* Register a deleted model event with the dispatcher.
331331
*
332-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
332+
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
333333
* @return void
334334
*/
335335
public static function deleted($callback)

0 commit comments

Comments
 (0)