This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -1,6 +1,275 @@
# Release Notes for 10.x
## [Unreleased](https://github.com/laravel/framework/compare/v10.41.0...10.x)
## [Unreleased](https://github.com/laravel/framework/compare/v10.48.28...10.x)
## [v10.48.28](https://github.com/laravel/framework/compare/v10.48.26...v10.48.28) - 2025-01-31
## [v10.48.26](https://github.com/laravel/framework/compare/v10.48.25...v10.48.26) - 2025-01-21
* [10.x] Refine error messages for detecting lost connections (Debian bookworm compatibility) by [@mfn](https://github.com/mfn) in https://github.com/laravel/framework/pull/53794
* [10.x] Bump minimum `league/commonmark` by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/53829
* [10.x] Backport 11.x PHP 8.4 fix for str_getcsv deprecation by [@aka-tpayne](https://github.com/aka-tpayne) in https://github.com/laravel/framework/pull/54074
## [v10.48.25](https://github.com/laravel/framework/compare/v10.48.24...v10.48.25) - 2024-11-26
* [10.x] PHP 8.4 Code Compatibility by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/53612
## [v10.48.24](https://github.com/laravel/framework/compare/v10.48.23...v10.48.24) - 2024-11-20
## [v10.48.23](https://github.com/laravel/framework/compare/v10.48.22...v10.48.23) - 2024-11-12
* [10.x] Ensure headers are only attached to illuminate responses by [@timacdonald](https://github.com/timacdonald) in https://github.com/laravel/framework/pull/53019
* [10.x] Fix append and prepend batch to chain by [@Bencute](https://github.com/Bencute) in https://github.com/laravel/framework/pull/53455
## [v10.48.22](https://github.com/laravel/framework/compare/v10.48.20...v10.48.22) - 2024-09-12
## [v10.48.20](https://github.com/laravel/framework/compare/v10.48.19...v10.48.20) - 2024-08-09
* [10.x] fix: prevent casting empty string to array from triggering json error by [@calebdw](https://github.com/calebdw) in https://github.com/laravel/framework/pull/52415
## [v10.48.19](https://github.com/laravel/framework/compare/v10.48.18...v10.48.19) - 2024-08-06
* Add compatible query type to `Model::resolveRouteBindingQuery` by [@sebj54](https://github.com/sebj54) in https://github.com/laravel/framework/pull/52339
* [10.x] Fix `Factory::afterCreating` callable argument type by [@villfa](https://github.com/villfa) in https://github.com/laravel/framework/pull/52335
* [10.x] backport #52204 by [@calebdw](https://github.com/calebdw) in https://github.com/laravel/framework/pull/52389
* [10.x] In MySQL, harvest last insert ID immediately after query is executed by [@piurafunk](https://github.com/piurafunk) in https://github.com/laravel/framework/pull/52390
## [v10.48.18](https://github.com/laravel/framework/compare/v10.48.17...v10.48.18) - 2024-07-30
* [10.x] backport #52188 by [@calebdw](https://github.com/calebdw) in https://github.com/laravel/framework/pull/52293
* [10.x] Fix runPaginationCountQuery not working properly for union queries by [@chinleung](https://github.com/chinleung) in https://github.com/laravel/framework/pull/52314
## [v10.48.17](https://github.com/laravel/framework/compare/v10.48.16...v10.48.17) - 2024-07-23
* [10.x] Fix PHP_CLI_SERVER_WORKERS warning by suppressing it by [@pelomedusa](https://github.com/pelomedusa) in https://github.com/laravel/framework/pull/52094
* [10.x] Backport #51615 by [@GrahamCampbell](https://github.com/GrahamCampbell) in https://github.com/laravel/framework/pull/52215
## [v10.48.16](https://github.com/laravel/framework/compare/v10.48.15...v10.48.16) - 2024-07-09
* [10.x] Fix Http::retry so that throw is respected for call signature Http::retry([1,2], throw: false) by [@paulyoungnb](https://github.com/paulyoungnb) in https://github.com/laravel/framework/pull/52002
* [10.x] Set application_name and character set as PostgreSQL DSN string by [@sunaoka](https://github.com/sunaoka) in https://github.com/laravel/framework/pull/51985
## [v10.48.15](https://github.com/laravel/framework/compare/v10.48.14...v10.48.15) - 2024-07-02
* [10.x] Set previous exception on `HttpResponseException` by [@hafezdivandari](https://github.com/hafezdivandari) in https://github.com/laravel/framework/pull/51986
## [v10.48.14](https://github.com/laravel/framework/compare/v10.48.13...v10.48.14) - 2024-06-21
* [10.x] Fixes unable to call another command as a initialized instance of `Command` class by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/51824
* [10.x] fix handle `shift()` on an empty collection by [@Treggats](https://github.com/Treggats) in https://github.com/laravel/framework/pull/51841
* [10.x] Ensure`schema:dump` will dump the migrations table only if it exists by [@NickSdot](https://github.com/NickSdot) in https://github.com/laravel/framework/pull/51827
## [v10.48.13](https://github.com/laravel/framework/compare/v10.48.12...v10.48.13) - 2024-06-18
* [10.x] Fix typo in return comment of createSesTransport method by [@zds-s](https://github.com/zds-s) in https://github.com/laravel/framework/pull/51688
* [10.x] Fix collection shift less than one item by [@faissaloux](https://github.com/faissaloux) in https://github.com/laravel/framework/pull/51686
* [10.x] Turn `Enumerable unless()` $callback parameter optional by [@faissaloux](https://github.com/faissaloux) in https://github.com/laravel/framework/pull/51701
* Revert "[10.x] Turn `Enumerable unless()` $callback parameter optional" by [@taylorotwell](https://github.com/taylorotwell) in https://github.com/laravel/framework/pull/51707
## [v10.48.12](https://github.com/laravel/framework/compare/v10.48.11...v10.48.12) - 2024-05-28
* [10.x] Fix typo by [@Issei0804-ie](https://github.com/Issei0804-ie) in https://github.com/laravel/framework/pull/51535
* [10.x] Fix SQL Server detection in database store by [@staudenmeir](https://github.com/staudenmeir) in https://github.com/laravel/framework/pull/51547
* [10.x] - Fix batch list loading in Horizon when serialization error by [@jeffortegad](https://github.com/jeffortegad) in https://github.com/laravel/framework/pull/51551
* [10.x] Fixes explicit route binding with `BackedEnum` by [@CAAHS](https://github.com/CAAHS) in https://github.com/laravel/framework/pull/51586
## [v10.48.11](https://github.com/laravel/framework/compare/v10.48.10...v10.48.11) - 2024-05-21
* [10.x] Backport: Fix SesV2Transport to use correct `EmailTags` argument by [@Tietew](https://github.com/Tietew) in https://github.com/laravel/framework/pull/51352
* [10.x] Fix PHPDoc typo by [@staudenmeir](https://github.com/staudenmeir) in https://github.com/laravel/framework/pull/51390
* [10.x] Fix `apa` on non ASCII characters by [@faissaloux](https://github.com/faissaloux) in https://github.com/laravel/framework/pull/51428
* [10.x] Fixes view engine resolvers leaking memory by [@nunomaduro](https://github.com/nunomaduro) in https://github.com/laravel/framework/pull/51450
* [10.x] Do not use `app()` Foundation helper on `ViewServiceProvider` by [@rodrigopedra](https://github.com/rodrigopedra) in https://github.com/laravel/framework/pull/51522
## [v10.48.10](https://github.com/laravel/framework/compare/v10.48.9...v10.48.10) - 2024-04-30
* [10.x] Fix typo in signed URL tampering tests by @Krisell in https://github.com/laravel/framework/pull/51238
* [10.x] Add "Server has gone away" to DetectsLostConnection by @Jubeki in https://github.com/laravel/framework/pull/51241
* [10.x] Fix support for the LARAVEL_STORAGE_PATH env var (#51238) by @dunglas in https://github.com/laravel/framework/pull/51243
## [v10.48.9](https://github.com/laravel/framework/compare/v10.48.8...v10.48.9) - 2024-04-23
* [10.x] Binding order is incorrect when using cursor paginate with multiple unions with a where by [@thijsvdanker](https://github.com/thijsvdanker) in https://github.com/laravel/framework/pull/50884
* [10.x] Fix cursor paginate with union and column alias by [@thijsvdanker](https://github.com/thijsvdanker) in https://github.com/laravel/framework/pull/50882
* [10.x] Address Null Parameter Deprecations in UrlGenerator by [@aldobarr](https://github.com/aldobarr) in https://github.com/laravel/framework/pull/51148
## [v10.48.8](https://github.com/laravel/framework/compare/v10.48.7...v10.48.8) - 2024-04-17
* [10.x] Fix error when using `orderByRaw()` in query before using `cursorPaginate()` by @axlon in https://github.com/laravel/framework/pull/51023
* [10.x] Database layer fixes by @saadsidqui in https://github.com/laravel/framework/pull/49787
## [v10.48.7](https://github.com/laravel/framework/compare/v10.48.6...v10.48.7) - 2024-04-10
* Fix more query builder methods by [@taylorotwell](https://github.com/taylorotwell) in https://github.com/laravel/framework/commit/95ef230339b15321493a08327f250c0760c95376
## [v10.48.6](https://github.com/laravel/framework/compare/v10.48.5...v10.48.6) - 2024-04-10
* [10.x] Added eachById and chunkByIdDesc to BelongsToMany by [@lonnylot](https://github.com/lonnylot) in https://github.com/laravel/framework/pull/50991
## [v10.48.5](https://github.com/laravel/framework/compare/v10.48.4...v10.48.5) - 2024-04-09
* [10.x] Prevent Redis connection error report flood on queue worker by [@kasus](https://github.com/kasus) in https://github.com/laravel/framework/pull/50812
* [10.x] Laravel 10x optional withSize for hasTable by [@apspan](https://github.com/apspan) in https://github.com/laravel/framework/pull/50888
* [10.x] Add `serializeAndRestore()` to `NotificationFake` by [@dbpolito](https://github.com/dbpolito) in https://github.com/laravel/framework/pull/50935
## [v10.48.4](https://github.com/laravel/framework/compare/v10.48.3...v10.48.4) - 2024-03-21
* [10.x] Fix `Collection::concat()` return type by @axlon in https://github.com/laravel/framework/pull/50669
* [10.x] Fix command alias registration and usage by @crynobone in https://github.com/laravel/framework/pull/50695
## [v10.48.3](https://github.com/laravel/framework/compare/v10.48.2...v10.48.3) - 2024-03-15
- Re-tag version
## [v10.48.2](https://github.com/laravel/framework/compare/v10.48.1...v10.48.2) - 2024-03-12
* [10.x] Update mockery conflict to just disallow the broken version by [@GrahamCampbell](https://github.com/GrahamCampbell) in https://github.com/laravel/framework/pull/50472
* [10.x] Conflict with specific release by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/50473
* [10.x] Fix for attributes being escaped on Dynamic Blade Components by [@pascalbaljet](https://github.com/pascalbaljet) in https://github.com/laravel/framework/pull/50471
* [10.x] Revert PR 50403 by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/50482
## [v10.48.1](https://github.com/laravel/framework/compare/v10.48.0...v10.48.1) - 2024-03-12
* [10.x] Add conflict for Mockery v1.6.8 by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/50468
## [v10.48.0](https://github.com/laravel/framework/compare/v10.47.0...v10.48.0) - 2024-03-12
* fix: allow null, string and string array as allowed tags by [@maartenpaauw](https://github.com/maartenpaauw) in https://github.com/laravel/framework/pull/50409
* [10.x] Allow `Expression` at more places in Query Builder by [@pascalbaljet](https://github.com/pascalbaljet) in https://github.com/laravel/framework/pull/50402
* [10.x] Sleep syncing by [@timacdonald](https://github.com/timacdonald) in https://github.com/laravel/framework/pull/50392
* [10.x] Cleaning Trait on multi-lines by [@gcazin](https://github.com/gcazin) in https://github.com/laravel/framework/pull/50413
* fix: incomplete type for Builder::from property by [@sebj54](https://github.com/sebj54) in https://github.com/laravel/framework/pull/50426
* [10.x] After commit callback throwing an exception causes broken transactions afterwards by [@oprypkhantc](https://github.com/oprypkhantc) in https://github.com/laravel/framework/pull/50423
* [10.x] Anonymous component bound attribute values are evaluated twice by [@danharrin](https://github.com/danharrin) in https://github.com/laravel/framework/pull/50403
* [10.x] Fix for sortByDesc ignoring multiple attributes by [@TWithers](https://github.com/TWithers) in https://github.com/laravel/framework/pull/50431
* [10.x] Allow sync with carbon to be set from fake method by [@abenerd](https://github.com/abenerd) in https://github.com/laravel/framework/pull/50450
* [10.x] Improves `Illuminate\Mail\Mailables\Envelope` docblock by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/50448
* [10.x] Incorrect return in `FileSystem.php` by [@gcazin](https://github.com/gcazin) in https://github.com/laravel/framework/pull/50459
* [10.x] fix return types by [@imahmood](https://github.com/imahmood) in https://github.com/laravel/framework/pull/50461
* fix: phpstan issue - right side of || always false by [@Carnicero90](https://github.com/Carnicero90) in https://github.com/laravel/framework/pull/50453
## [v10.47.0](https://github.com/laravel/framework/compare/v10.46.0...v10.47.0) - 2024-03-05
* [10.x] Allow for relation key to be an enum by [@AJenbo](https://github.com/AJenbo) in https://github.com/laravel/framework/pull/50311
* FIx for "empty" strings passed to Str::apa() by [@tiagof](https://github.com/tiagof) in https://github.com/laravel/framework/pull/50335
* [10.x] Fixed header mail text component to not use markdown by [@dmyers](https://github.com/dmyers) in https://github.com/laravel/framework/pull/50332
* [10.x] Add test for the "empty strings in `Str::apa()`" fix by [@osbre](https://github.com/osbre) in https://github.com/laravel/framework/pull/50340
* [10.x] Fix the cache cannot expire cache with `0` TTL by [@kayw-geek](https://github.com/kayw-geek) in https://github.com/laravel/framework/pull/50359
* [10.x] Add fail on timeout to queue listener by [@saeedhosseiinii](https://github.com/saeedhosseiinii) in https://github.com/laravel/framework/pull/50352
* [10.x] Support sort option flags on sortByMany Collections by [@TWithers](https://github.com/TWithers) in https://github.com/laravel/framework/pull/50269
* [10.x] Add `whereAll` and `whereAny` methods to the query builder by [@musiermoore](https://github.com/musiermoore) in https://github.com/laravel/framework/pull/50344
* [10.x] Adds Reverb broadcasting driver by [@joedixon](https://github.com/joedixon) in https://github.com/laravel/framework/pull/50088
## [v10.46.0](https://github.com/laravel/framework/compare/v10.45.1...v10.46.0) - 2024-02-27
* [10.x] Ensure lazy-loading for trashed morphTo relations works by [@nuernbergerA](https://github.com/nuernbergerA) in https://github.com/laravel/framework/pull/50176
* [10.x] Arr::select not working when $keys is a string by [@Sicklou](https://github.com/Sicklou) in https://github.com/laravel/framework/pull/50169
* [10.x] Added passing loaded relationship to value callback by [@dkulyk](https://github.com/dkulyk) in https://github.com/laravel/framework/pull/50167
* [10.x] Fix optional charset and collation when creating database by [@GrahamCampbell](https://github.com/GrahamCampbell) in https://github.com/laravel/framework/pull/50168
* [10.x] update doc block in PendingProcess.php by [@saMahmoudzadeh](https://github.com/saMahmoudzadeh) in https://github.com/laravel/framework/pull/50198
* [10.x] Fix Accepting nullable Parameters, updated doc block, and null pointer exception handling in batchable trait by [@saMahmoudzadeh](https://github.com/saMahmoudzadeh) in https://github.com/laravel/framework/pull/50209
* Make GuardsAttributes fillable property DocBlock more specific by [@liamduckett](https://github.com/liamduckett) in https://github.com/laravel/framework/pull/50229
* [10.x] Add only and except methods to Enum validation rule by [@Anton5360](https://github.com/Anton5360) in https://github.com/laravel/framework/pull/50226
* [10.x] Fixes on nesting operations performed while applying scopes. by [@Guilhem-DELAITRE](https://github.com/Guilhem-DELAITRE) in https://github.com/laravel/framework/pull/50207
* [10.x] Custom RateLimiter increase by [@khepin](https://github.com/khepin) in https://github.com/laravel/framework/pull/50197
* [10.x] Add Lateral Join to Query Builder by [@Bakke](https://github.com/Bakke) in https://github.com/laravel/framework/pull/50050
* [10.x] Update return type by [@AmirRezaM75](https://github.com/AmirRezaM75) in https://github.com/laravel/framework/pull/50252
* [10.x] Fix dockblock by [@michaelnabil230](https://github.com/michaelnabil230) in https://github.com/laravel/framework/pull/50259
* [10.x] Add `Conditionable` in enum rule by [@michaelnabil230](https://github.com/michaelnabil230) in https://github.com/laravel/framework/pull/50257
* [10.x] Update Facade::$app to nullable by [@villfa](https://github.com/villfa) in https://github.com/laravel/framework/pull/50260
* [10.x] Truncate sqlite table name with prefix by [@kitloong](https://github.com/kitloong) in https://github.com/laravel/framework/pull/50251
* Correction comment for Str::orderedUuid() - https://github.com/larave… by [@wq9578](https://github.com/wq9578) in https://github.com/laravel/framework/pull/50268
## [v10.45.1](https://github.com/laravel/framework/compare/v10.45.0...v10.45.1) - 2024-02-21
* Fix typehint for ResetPassword::toMailUsing() by [@KKSzymanowski](https://github.com/KKSzymanowski) in https://github.com/laravel/framework/pull/50163
* [10.x] Fix Process::fake() never matching multi-line commands by [@SjorsO](https://github.com/SjorsO) in https://github.com/laravel/framework/pull/50164
## [v10.45.0](https://github.com/laravel/framework/compare/v10.44.0...v10.45.0) - 2024-02-20
* [10.x] Update `Stringable` phpdoc by [@milwad-dev](https://github.com/milwad-dev) in https://github.com/laravel/framework/pull/50075
* [10.x] Allow `Collection::select()` to work on `ArrayAccess` by [@axlon](https://github.com/axlon) in https://github.com/laravel/framework/pull/50072
* [10.x] Add `before` to the `PendingBatch` by [@xiCO2k](https://github.com/xiCO2k) in https://github.com/laravel/framework/pull/50058
* [10.x] Adjust rules call sequence by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/50084
* [10.x] Fixes `Illuminate\Support\Str::fromBase64()` return type by [@SamAsEnd](https://github.com/SamAsEnd) in https://github.com/laravel/framework/pull/50108
* [10.x] Actually fix fromBase64 return type by [@GrahamCampbell](https://github.com/GrahamCampbell) in https://github.com/laravel/framework/pull/50113
* [10.x] Fix warning and deprecation for Str::api by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/50114
* [10.x] Mark model instanse as not exists on deleting MorphPivot relation. by [@dkulyk](https://github.com/dkulyk) in https://github.com/laravel/framework/pull/50135
* [10.x] Adds Tappable and Conditionable to Relation class by [@DarkGhostHunter](https://github.com/DarkGhostHunter) in https://github.com/laravel/framework/pull/50124
* [10.x] Added getQualifiedMorphTypeName to MorphToMany by [@dkulyk](https://github.com/dkulyk) in https://github.com/laravel/framework/pull/50153
## [v10.44.0](https://github.com/laravel/framework/compare/v10.43.0...v10.44.0) - 2024-02-13
* [10.x] Fix empty request for HTTP connection exception by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/49924
* [10.x] Add Collection::select() method by [@morrislaptop](https://github.com/morrislaptop) in https://github.com/laravel/framework/pull/49845
* [10.x] Refactor `getPreviousUrlFromSession` method in UrlGenerator by [@milwad-dev](https://github.com/milwad-dev) in https://github.com/laravel/framework/pull/49944
* [10.x] Add POSIX compliant cleanup to artisan serve by [@Tofandel](https://github.com/Tofandel) in https://github.com/laravel/framework/pull/49943
* [10.x] Fix infinite loop when global scopes query contains aggregates by [@mateusjunges](https://github.com/mateusjunges) in https://github.com/laravel/framework/pull/49972
* [10.x] Adds PHPUnit 11 as conflict by [@nunomaduro](https://github.com/nunomaduro) in https://github.com/laravel/framework/pull/49957
* Revert "[10.x] fix Before/After validation rules" by [@taylorotwell](https://github.com/taylorotwell) in https://github.com/laravel/framework/pull/50013
* [10.x] Fix the phpdoc for replaceMatches in Str and Stringable helpers by [@joke2k](https://github.com/joke2k) in https://github.com/laravel/framework/pull/49990
* [10.x] Added `setAbly()` method for `AblyBroadcaster` by [@Rijoanul-Shanto](https://github.com/Rijoanul-Shanto) in https://github.com/laravel/framework/pull/49981
* [10.x] Fix in appendExceptionToException method exception type check by [@t1nkl](https://github.com/t1nkl) in https://github.com/laravel/framework/pull/49958
* [10.x] DB command: add sqlcmd -C flag when 'trust_server_certificate' is set by [@hulkur](https://github.com/hulkur) in https://github.com/laravel/framework/pull/49952
* Allows Setup and Teardown actions to be reused in alternative TestCase for Laravel by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/49973
* [10.x] Add `toBase64()` and `fromBase64()` methods to Stringable and Str classes by [@mtownsend5512](https://github.com/mtownsend5512) in https://github.com/laravel/framework/pull/49984
* [10.x] Allows to defer resolving pcntl only if it's available by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/50024
* [10.x] Fixes missing `Throwable` import and handle if `originalExceptionHandler` or `originalDeprecationHandler` property isn't used by alternative TestCase by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/50021
* [10.x] Type hinting for conditional validation rules by [@lorenzolosa](https://github.com/lorenzolosa) in https://github.com/laravel/framework/pull/50017
* [10.x] Introduce new `Arr::take()` helper by [@ryangjchandler](https://github.com/ryangjchandler) in https://github.com/laravel/framework/pull/50015
* [10.x] Improved Handling of Empty Component Slots with HTML Comments or Line Breaks by [@comes](https://github.com/comes) in https://github.com/laravel/framework/pull/49966
* [10.x] Introduce Observe attribute for models by [@emargareten](https://github.com/emargareten) in https://github.com/laravel/framework/pull/49843
* [10.x] Add ScopedBy attribute for models by [@emargareten](https://github.com/emargareten) in https://github.com/laravel/framework/pull/50034
* [10.x] Update reserved names in `GeneratorCommand` by [@xurshudyan](https://github.com/xurshudyan) in https://github.com/laravel/framework/pull/50043
* [10.x] fix Validator::validated get nullable array by [@helitik](https://github.com/helitik) in https://github.com/laravel/framework/pull/50056
* [10.x] Pass Herd specific env variables to "artisan serve" by [@mpociot](https://github.com/mpociot) in https://github.com/laravel/framework/pull/50069
* Remove regex case insensitivity modifier in UUID detection to speed it up slightly by [@maximal](https://github.com/maximal) in https://github.com/laravel/framework/pull/50067
* [10.x] HTTP retry method can accept array as first param by [@me-shaon](https://github.com/me-shaon) in https://github.com/laravel/framework/pull/50064
* [10.x] Fix DB::afterCommit() broken in tests using DatabaseTransactions by [@oprypkhantc](https://github.com/oprypkhantc) in https://github.com/laravel/framework/pull/50068
## [v10.43.0](https://github.com/laravel/framework/compare/v10.42.0...v10.43.0) - 2024-01-30
* [10.x] Add storage:unlink command by [@salkovmx](https://github.com/salkovmx) in https://github.com/laravel/framework/pull/49795
* [10.x] Unify `\Illuminate\Log\LogManager` method definition comments with `\Psr\Logger\Interface` by [@eusonlito](https://github.com/eusonlito) in https://github.com/laravel/framework/pull/49805
* [10.x] class-name string argument for global scopes by [@emargareten](https://github.com/emargareten) in https://github.com/laravel/framework/pull/49802
* [10.x] Add `hasIndex()` and minor Schema enhancements by [@hafezdivandari](https://github.com/hafezdivandari) in https://github.com/laravel/framework/pull/49796
* [10.x] Do not touch `BelongsToMany` relation when using `withoutTouching` by [@mateusjunges](https://github.com/mateusjunges) in https://github.com/laravel/framework/pull/49798
* [10.x] Check properties on mailables are initialized before sharing with the view by [@j3j5](https://github.com/j3j5) in https://github.com/laravel/framework/pull/49813
* [10.x] Remove duplicate actions/checkout from queue workflow by [@Jubeki](https://github.com/Jubeki) in https://github.com/laravel/framework/pull/49828
* [10.x] Add `insertOrIgnoreUsing` for Eloquent by [@trovster](https://github.com/trovster) in https://github.com/laravel/framework/pull/49827
* [10.x] Make `hasIndex()` Order-sensitive by [@hafezdivandari](https://github.com/hafezdivandari) in https://github.com/laravel/framework/pull/49840
* [10.x] Release action by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/49838
* [10.x] Add MariaDb1060Platform by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/49848
* [10.x] Unified Pivot and Model Doc Block `$guarded` by [@eusonlito](https://github.com/eusonlito) in https://github.com/laravel/framework/pull/49851
* [10.x] Introducing `beforeStartingTransaction` callback and use it in `LazilyRefreshDatabase` by [@pascalbaljet](https://github.com/pascalbaljet) in https://github.com/laravel/framework/pull/49853
* [10.x] fix password max validation message by [@MrPunyapal](https://github.com/MrPunyapal) in https://github.com/laravel/framework/pull/49861
* [10.x] Fix validation message used for max file size by [@mateusjunges](https://github.com/mateusjunges) in https://github.com/laravel/framework/pull/49879
* Update README.md by [@foremtehan](https://github.com/foremtehan) in https://github.com/laravel/framework/pull/49878
* [10.x] Adds `FormRequest[@getRules](https://github.com/getRules)()` method by [@cosmastech](https://github.com/cosmastech) in https://github.com/laravel/framework/pull/49860
* [10.x] add addGlobalScopes method by [@emargareten](https://github.com/emargareten) in https://github.com/laravel/framework/pull/49880
* [10.x] Allow brick/math 0.12 by [@LogicSatinn](https://github.com/LogicSatinn) in https://github.com/laravel/framework/pull/49883
* [10.x] Add support for streamed JSON Response by [@pelmered](https://github.com/pelmered) in https://github.com/laravel/framework/pull/49873
* [10.x] Using the native fopen exception in LockableFile.php by [@eusonlito](https://github.com/eusonlito) in https://github.com/laravel/framework/pull/49895
* [10.x] Fix LazilyRefreshDatabase when testing artisan commands by [@iamgergo](https://github.com/iamgergo) in https://github.com/laravel/framework/pull/49914
* [10.x] Fix expressions in with-functions doing aggregates by [@tpetry](https://github.com/tpetry) in https://github.com/laravel/framework/pull/49912
* [10.x] Fix redis tag entries never becoming stale if cache ttl is past time by [@jagers](https://github.com/jagers) in https://github.com/laravel/framework/pull/49864
* [10.x] Fix - The `Translator` may incorrectly report the locale of a missing translation key by [@VicGUTT](https://github.com/VicGUTT) in https://github.com/laravel/framework/pull/49900
* [10.x] fix Before/After validation rules by [@MrPunyapal](https://github.com/MrPunyapal) in https://github.com/laravel/framework/pull/49871
## [v10.42.0](https://github.com/laravel/framework/compare/v10.41.0...v10.42.0) - 2024-01-23
* [10.x] Switch to hash_equals in `File::hasSameHash()` by [@simonhamp](https://github.com/simonhamp) in https://github.com/laravel/framework/pull/49721
* [10.x] fix Rule::unless for callable $condition by [@dbakan](https://github.com/dbakan) in https://github.com/laravel/framework/pull/49726
* [10.x] Adds JobQueueing event by [@dmason30](https://github.com/dmason30) in https://github.com/laravel/framework/pull/49722
* [10.x] Fix decoding issue in MailLogTransport by [@rojtjo](https://github.com/rojtjo) in https://github.com/laravel/framework/pull/49727
* [10.x] Implement "max" validation rule for passwords by [@angelej](https://github.com/angelej) in https://github.com/laravel/framework/pull/49739
* [10.x] Add multiple channels/routes to AnonymousNotifiable at once by [@iamgergo](https://github.com/iamgergo) in https://github.com/laravel/framework/pull/49745
* [10.x] Sort service providers alphabetically by [@buismaarten](https://github.com/buismaarten) in https://github.com/laravel/framework/pull/49762
* [10.x] Global default options for the http factory by [@timacdonald](https://github.com/timacdonald) in https://github.com/laravel/framework/pull/49767
* [10.x] Only use `Carbon` if accessed from Laravel or also uses `illuminate/support` by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/49772
* [10.x] Add `Str::unwrap` by [@stevebauman](https://github.com/stevebauman) in https://github.com/laravel/framework/pull/49779
* [10.x] Allow Uuid and Ulid in Carbon::createFromId() by [@kylekatarnls](https://github.com/kylekatarnls) in https://github.com/laravel/framework/pull/49783
* [10.x] Test Improvements by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/49785
## [v10.41.0](https://github.com/laravel/framework/compare/v10.40.0...v10.41.0) - 2024-01-16

View File

@@ -28,7 +28,7 @@ Laravel has the most extensive and thorough documentation and video tutorial lib
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 1100 video tutorials covering a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.
If you're not in the mood to read, [Laracasts](https://laracasts.com) contains thousands of video tutorials covering a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.
## Contributing

5
vendor/laravel/framework/RELEASE.md vendored Normal file
View File

@@ -0,0 +1,5 @@
# Release Instructions
Go to the ["manual release" GitHub Action](https://github.com/laravel/framework/actions/workflows/releases.yml). Then, choose "Run workflow", select the correct branch, and enter the version you wish to release. Next, press "Run workflow" to execute the action. The workflow will automatically update the version in `Application.php`, tag a new release, run the splitter script for the Illuminate components, generate release notes, create a GitHub Release, and update the `CHANGELOG.md` file.
<img width="400" alt="Screenshot 2024-05-06 at 10 46 04" src="https://github.com/laravel/framework/assets/594614/4dc5efc8-946e-4e96-9e79-8e26f92ea354">

View File

@@ -24,7 +24,7 @@
"ext-session": "*",
"ext-tokenizer": "*",
"composer-runtime-api": "^2.2",
"brick/math": "^0.9.3|^0.10.2|^0.11",
"brick/math": "^0.9.3|^0.10.2|^0.11|^0.12",
"doctrine/inflector": "^2.0.5",
"dragonmantank/cron-expression": "^3.3.2",
"egulias/email-validator": "^3.2.1|^4.0",
@@ -105,9 +105,9 @@
"league/flysystem-sftp-v3": "^3.0",
"mockery/mockery": "^1.5.1",
"nyholm/psr7": "^1.2",
"orchestra/testbench-core": "^8.18",
"orchestra/testbench-core": "^8.23.4",
"pda/pheanstalk": "^4.0",
"phpstan/phpstan": "^1.4.7",
"phpstan/phpstan": "~1.11.11",
"phpunit/phpunit": "^10.0.7",
"predis/predis": "^2.0.2",
"symfony/cache": "^6.2",
@@ -121,7 +121,9 @@
"conflict": {
"carbonphp/carbon-doctrine-types": ">=3.0",
"doctrine/dbal": ">=4.0",
"tightenco/collect": "<5.5.33"
"mockery/mockery": "1.6.8",
"tightenco/collect": "<5.5.33",
"phpunit/phpunit": ">=11.0.0"
},
"autoload": {
"files": [

View File

@@ -29,7 +29,7 @@ class AuthorizationException extends Exception
* @param \Throwable|null $previous
* @return void
*/
public function __construct($message = null, $code = null, Throwable $previous = null)
public function __construct($message = null, $code = null, ?Throwable $previous = null)
{
parent::__construct($message ?? 'This action is unauthorized.', 0, $previous);

View File

@@ -100,7 +100,7 @@ class Gate implements GateContract
array $policies = [],
array $beforeCallbacks = [],
array $afterCallbacks = [],
callable $guessPolicyNamesUsingCallback = null)
?callable $guessPolicyNamesUsingCallback = null)
{
$this->policies = $policies;
$this->container = $container;
@@ -224,7 +224,7 @@ class Gate implements GateContract
* @param array|null $abilities
* @return $this
*/
public function resource($name, $class, array $abilities = null)
public function resource($name, $class, ?array $abilities = null)
{
$abilities = $abilities ?: [
'viewAny' => 'viewAny',

0
vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php vendored Normal file → Executable file
View File

View File

View File

View File

0
vendor/laravel/framework/src/Illuminate/Auth/GenericUser.php vendored Normal file → Executable file
View File

View File

@@ -25,7 +25,7 @@ class ResetPassword extends Notification
/**
* The callback that should be used to build the mail message.
*
* @var (\Closure(mixed, string): \Illuminate\Notifications\Messages\MailMessage)|null
* @var (\Closure(mixed, string): \Illuminate\Notifications\Messages\MailMessage|\Illuminate\Contracts\Mail\Mailable)|null
*/
public static $toMailCallback;
@@ -114,7 +114,7 @@ class ResetPassword extends Notification
/**
* Set a callback that should be used when building the notification mail message.
*
* @param \Closure(mixed, string): \Illuminate\Notifications\Messages\MailMessage $callback
* @param \Closure(mixed, string): (\Illuminate\Notifications\Messages\MailMessage|\Illuminate\Contracts\Mail\Mailable) $callback
* @return void
*/
public static function toMailUsing($callback)

View File

View File

@@ -45,7 +45,7 @@ class PasswordBroker implements PasswordBrokerContract
* @param \Closure|null $callback
* @return string
*/
public function sendResetLink(array $credentials, Closure $callback = null)
public function sendResetLink(array $credentials, ?Closure $callback = null)
{
// First we will check to see if we found a user at the given credentials and
// if we did not we will redirect back to this current URI with a piece of

View File

View File

@@ -33,7 +33,7 @@ class RequestGuard implements Guard
* @param \Illuminate\Contracts\Auth\UserProvider|null $provider
* @return void
*/
public function __construct(callable $callback, Request $request, UserProvider $provider = null)
public function __construct(callable $callback, Request $request, ?UserProvider $provider = null)
{
$this->request = $request;
$this->callback = $callback;

View File

@@ -123,8 +123,8 @@ class SessionGuard implements StatefulGuard, SupportsBasicAuth
public function __construct($name,
UserProvider $provider,
Session $session,
Request $request = null,
Timebox $timebox = null)
?Request $request = null,
?Timebox $timebox = null)
{
$this->name = $name;
$this->session = $session;

View File

@@ -92,7 +92,7 @@ class TokenGuard implements Guard
/**
* Get the token for the current request.
*
* @return string
* @return string|null
*/
public function getTokenForRequest()
{

View File

@@ -64,7 +64,7 @@ class BroadcastManager implements FactoryContract
* @param array|null $attributes
* @return void
*/
public function routes(array $attributes = null)
public function routes(?array $attributes = null)
{
if ($this->app instanceof CachesRoutes && $this->app->routesAreCached()) {
return;
@@ -86,7 +86,7 @@ class BroadcastManager implements FactoryContract
* @param array|null $attributes
* @return void
*/
public function userRoutes(array $attributes = null)
public function userRoutes(?array $attributes = null)
{
if ($this->app instanceof CachesRoutes && $this->app->routesAreCached()) {
return;
@@ -110,7 +110,7 @@ class BroadcastManager implements FactoryContract
* @param array|null $attributes
* @return void
*/
public function channelRoutes(array $attributes = null)
public function channelRoutes(?array $attributes = null)
{
$this->routes($attributes);
}
@@ -273,6 +273,17 @@ class BroadcastManager implements FactoryContract
return $this->customCreators[$config['driver']]($this->app, $config);
}
/**
* Create an instance of the driver.
*
* @param array $config
* @return \Illuminate\Contracts\Broadcasting\Broadcaster
*/
protected function createReverbDriver(array $config)
{
return $this->createPusherDriver($config);
}
/**
* Create an instance of the driver.
*

View File

@@ -232,4 +232,15 @@ class AblyBroadcaster extends Broadcaster
{
return $this->ably;
}
/**
* Set the underlying Ably SDK instance.
*
* @param \Ably\AblyRest $ably
* @return void
*/
public function setAbly($ably)
{
$this->ably = $ably;
}
}

View File

@@ -450,7 +450,7 @@ class Batch implements Arrayable, JsonSerializable
* @param \Throwable|null $e
* @return void
*/
protected function invokeHandlerCallback($handler, Batch $batch, Throwable $e = null)
protected function invokeHandlerCallback($handler, Batch $batch, ?Throwable $e = null)
{
try {
return $handler($batch, $e);

View File

@@ -35,7 +35,7 @@ trait Batchable
}
if ($this->batchId) {
return Container::getInstance()->make(BatchRepository::class)->find($this->batchId);
return Container::getInstance()->make(BatchRepository::class)?->find($this->batchId);
}
}
@@ -74,7 +74,7 @@ trait Batchable
* @param int $failedJobs
* @param array $failedJobIds
* @param array $options
* @param \Carbon\CarbonImmutable $createdAt
* @param \Carbon\CarbonImmutable|null $createdAt
* @param \Carbon\CarbonImmutable|null $cancelledAt
* @param \Carbon\CarbonImmutable|null $finishedAt
* @return array{0: $this, 1: \Illuminate\Support\Testing\Fakes\BatchFake}
@@ -86,7 +86,7 @@ trait Batchable
int $failedJobs = 0,
array $failedJobIds = [],
array $options = [],
CarbonImmutable $createdAt = null,
?CarbonImmutable $createdAt = null,
?CarbonImmutable $cancelledAt = null,
?CarbonImmutable $finishedAt = null)
{

View File

@@ -6,10 +6,10 @@ use Carbon\CarbonImmutable;
use Closure;
use DateTimeInterface;
use Illuminate\Database\Connection;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Database\PostgresConnection;
use Illuminate\Database\Query\Expression;
use Illuminate\Support\Str;
use Throwable;
class DatabaseBatchRepository implements PrunableBatchRepository
{
@@ -352,7 +352,7 @@ class DatabaseBatchRepository implements PrunableBatchRepository
try {
return unserialize($serialized);
} catch (ModelNotFoundException) {
} catch (Throwable) {
return [];
}
}

View File

@@ -58,7 +58,7 @@ class Dispatcher implements QueueingDispatcher
* @param \Closure|null $queueResolver
* @return void
*/
public function __construct(Container $container, Closure $queueResolver = null)
public function __construct(Container $container, ?Closure $queueResolver = null)
{
$this->container = $container;
$this->queueResolver = $queueResolver;

View File

@@ -74,6 +74,31 @@ class PendingBatch
return $this;
}
/**
* Add a callback to be executed when the batch is stored.
*
* @param callable $callback
* @return $this
*/
public function before($callback)
{
$this->options['before'][] = $callback instanceof Closure
? new SerializableClosure($callback)
: $callback;
return $this;
}
/**
* Get the "before" callbacks that have been registered with the pending batch.
*
* @return array
*/
public function beforeCallbacks()
{
return $this->options['before'] ?? [];
}
/**
* Add a callback to be executed after a job in the batch have executed successfully.
*
@@ -282,7 +307,7 @@ class PendingBatch
$repository = $this->container->make(BatchRepository::class);
try {
$batch = $repository->store($this);
$batch = $this->store($repository);
$batch = $batch->add($this->jobs);
} catch (Throwable $e) {
@@ -309,7 +334,7 @@ class PendingBatch
{
$repository = $this->container->make(BatchRepository::class);
$batch = $repository->store($this);
$batch = $this->store($repository);
if ($batch) {
$this->container->terminating(function () use ($batch) {
@@ -366,4 +391,27 @@ class PendingBatch
{
return ! value($boolean) ? $this->dispatch() : null;
}
/**
* Store the batch using the given repository.
*
* @param \Illuminate\Bus\BatchRepository $repository
* @return \Illuminate\Bus\Batch
*/
protected function store($repository)
{
$batch = $repository->store($this);
collect($this->beforeCallbacks())->each(function ($handler) use ($batch) {
try {
return $handler($batch);
} catch (Throwable $e) {
if (function_exists('report')) {
report($e);
}
}
});
return $batch;
}
}

View File

@@ -199,6 +199,11 @@ trait Queueable
*/
public function prependToChain($job)
{
$job = match (true) {
$job instanceof PendingBatch => new ChainedBatch($job),
default => $job,
};
$this->chained = Arr::prepend($this->chained, $this->serializeJob($job));
return $this;
@@ -212,6 +217,11 @@ trait Queueable
*/
public function appendToChain($job)
{
$job = match (true) {
$job instanceof PendingBatch => new ChainedBatch($job),
default => $job,
};
$this->chained = array_merge($this->chained, [$this->serializeJob($job)]);
return $this;

0
vendor/laravel/framework/src/Illuminate/Cache/ApcStore.php vendored Normal file → Executable file
View File

0
vendor/laravel/framework/src/Illuminate/Cache/ApcWrapper.php vendored Normal file → Executable file
View File

0
vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php vendored Normal file → Executable file
View File

View File

View File

View File

View File

@@ -29,7 +29,7 @@ class PruneStaleTagsCommand extends Command
* Execute the console command.
*
* @param \Illuminate\Cache\CacheManager $cache
* @return void
* @return int|null
*/
public function handle(CacheManager $cache)
{

4
vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php vendored Normal file → Executable file
View File

@@ -158,9 +158,7 @@ class DatabaseStore implements LockProvider, Store
$value = $this->serialize($value);
$expiration = $this->getTime() + $seconds;
$doesntSupportInsertOrIgnore = [SqlServerConnection::class];
if (! in_array(get_class($this->getConnection()), $doesntSupportInsertOrIgnore)) {
if (! $this->getConnection() instanceof SqlServerConnection) {
return $this->table()->insertOrIgnore(compact('key', 'value', 'expiration')) > 0;
}

0
vendor/laravel/framework/src/Illuminate/Cache/FileStore.php vendored Normal file → Executable file
View File

View File

0
vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php vendored Normal file → Executable file
View File

0
vendor/laravel/framework/src/Illuminate/Cache/NullStore.php vendored Normal file → Executable file
View File

View File

@@ -105,13 +105,26 @@ class RateLimiter
}
/**
* Increment the counter for a given key for a given decay time.
* Increment (by 1) the counter for a given key for a given decay time.
*
* @param string $key
* @param int $decaySeconds
* @return int
*/
public function hit($key, $decaySeconds = 60)
{
return $this->increment($key, $decaySeconds);
}
/**
* Increment the counter for a given key for a given decay time by a given amount.
*
* @param string $key
* @param int $decaySeconds
* @param int $amount
* @return int
*/
public function increment($key, $decaySeconds = 60, $amount = 1)
{
$key = $this->cleanRateLimiterKey($key);
@@ -121,7 +134,7 @@ class RateLimiter
$added = $this->cache->add($key, 0, $decaySeconds);
$hits = (int) $this->cache->increment($key);
$hits = (int) $this->cache->increment($key, $amount);
if (! $added && $hits == 1) {
$this->cache->put($key, 1, $decaySeconds);

0
vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php vendored Normal file → Executable file
View File

View File

@@ -11,13 +11,13 @@ class RedisTagSet extends TagSet
* Add a reference entry to the tag set's underlying sorted set.
*
* @param string $key
* @param int $ttl
* @param int|null $ttl
* @param string $updateWhen
* @return void
*/
public function addEntry(string $key, int $ttl = 0, $updateWhen = null)
public function addEntry(string $key, ?int $ttl = null, $updateWhen = null)
{
$ttl = $ttl > 0 ? Carbon::now()->addSeconds($ttl)->getTimestamp() : -1;
$ttl = is_null($ttl) ? -1 : Carbon::now()->addSeconds($ttl)->getTimestamp();
foreach ($this->tagIds() as $tagKey) {
if ($updateWhen) {

View File

@@ -14,10 +14,18 @@ class RedisTaggedCache extends TaggedCache
*/
public function add($key, $value, $ttl = null)
{
$this->tags->addEntry(
$this->itemKey($key),
! is_null($ttl) ? $this->getSeconds($ttl) : 0
);
$seconds = null;
if ($ttl !== null) {
$seconds = $this->getSeconds($ttl);
if ($seconds > 0) {
$this->tags->addEntry(
$this->itemKey($key),
$seconds
);
}
}
return parent::add($key, $value, $ttl);
}
@@ -36,10 +44,14 @@ class RedisTaggedCache extends TaggedCache
return $this->forever($key, $value);
}
$this->tags->addEntry(
$this->itemKey($key),
$this->getSeconds($ttl)
);
$seconds = $this->getSeconds($ttl);
if ($seconds > 0) {
$this->tags->addEntry(
$this->itemKey($key),
$seconds
);
}
return parent::put($key, $value, $ttl);
}

3
vendor/laravel/framework/src/Illuminate/Cache/Repository.php vendored Normal file → Executable file
View File

@@ -22,8 +22,7 @@ use Illuminate\Support\Traits\Macroable;
*/
class Repository implements ArrayAccess, CacheContract
{
use InteractsWithTime;
use Macroable {
use InteractsWithTime, Macroable {
__call as macroCall;
}

0
vendor/laravel/framework/src/Illuminate/Cache/composer.json vendored Normal file → Executable file
View File

View File

@@ -185,7 +185,7 @@ class Arr
* @param mixed $default
* @return mixed
*/
public static function first($array, callable $callback = null, $default = null)
public static function first($array, ?callable $callback = null, $default = null)
{
if (is_null($callback)) {
if (empty($array)) {
@@ -216,7 +216,7 @@ class Arr
* @param mixed $default
* @return mixed
*/
public static function last($array, callable $callback = null, $default = null)
public static function last($array, ?callable $callback = null, $default = null)
{
if (is_null($callback)) {
return empty($array) ? value($default) : end($array);
@@ -225,6 +225,22 @@ class Arr
return static::first(array_reverse($array, true), $callback, $default);
}
/**
* Take the first or last {$limit} items from an array.
*
* @param array $array
* @param int $limit
* @return array
*/
public static function take($array, $limit)
{
if ($limit < 0) {
return array_slice($array, $limit, abs($limit));
}
return array_slice($array, 0, $limit);
}
/**
* Flatten a multi-dimensional array into a single level.
*
@@ -491,6 +507,32 @@ class Arr
return array_intersect_key($array, array_flip((array) $keys));
}
/**
* Select an array of values from an array.
*
* @param array $array
* @param array|string $keys
* @return array
*/
public static function select($array, $keys)
{
$keys = static::wrap($keys);
return static::map($array, function ($item) use ($keys) {
$result = [];
foreach ($keys as $key) {
if (Arr::accessible($item) && Arr::exists($item, $key)) {
$result[$key] = $item[$key];
} elseif (is_object($item) && isset($item->{$key})) {
$result[$key] = $item->{$key};
}
}
return $result;
});
}
/**
* Pluck an array of values from an array.
*

View File

@@ -7,6 +7,7 @@ use ArrayIterator;
use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString;
use Illuminate\Support\Traits\EnumeratesValues;
use Illuminate\Support\Traits\Macroable;
use InvalidArgumentException;
use stdClass;
use Traversable;
@@ -381,7 +382,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* @param (callable(TValue, TKey): bool)|null $callback
* @return static
*/
public function filter(callable $callback = null)
public function filter(?callable $callback = null)
{
if ($callback) {
return new static(Arr::where($this->items, $callback));
@@ -399,7 +400,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* @param TFirstDefault|(\Closure(): TFirstDefault) $default
* @return TValue|TFirstDefault
*/
public function first(callable $callback = null, $default = null)
public function first(?callable $callback = null, $default = null)
{
return Arr::first($this->items, $callback, $default);
}
@@ -747,7 +748,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* @param TLastDefault|(\Closure(): TLastDefault) $default
* @return TValue|TLastDefault
*/
public function last(callable $callback = null, $default = null)
public function last(?callable $callback = null, $default = null)
{
return Arr::last($this->items, $callback, $default);
}
@@ -918,6 +919,27 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
return new static(Arr::only($this->items, $keys));
}
/**
* Select specific values from the items within the collection.
*
* @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey>|string|null $keys
* @return static
*/
public function select($keys)
{
if (is_null($keys)) {
return new static($this->items);
}
if ($keys instanceof Enumerable) {
$keys = $keys->all();
}
$keys = is_array($keys) ? $keys : func_get_args();
return new static(Arr::select($this->items, $keys));
}
/**
* Get and remove the last N items from the collection.
*
@@ -977,8 +999,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Push all of the given items onto the collection.
*
* @param iterable<array-key, TValue> $source
* @return static
* @template TConcatKey of array-key
* @template TConcatValue
*
* @param iterable<TConcatKey, TConcatValue> $source
* @return static<TKey|TConcatKey, TValue|TConcatValue>
*/
public function concat($source)
{
@@ -1100,17 +1125,27 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
*
* @param int $count
* @return static<int, TValue>|TValue|null
*
* @throws \InvalidArgumentException
*/
public function shift($count = 1)
{
if ($count === 1) {
return array_shift($this->items);
if ($count < 0) {
throw new InvalidArgumentException('Number of shifted items may not be less than zero.');
}
if ($this->isEmpty()) {
return null;
}
if ($count === 0) {
return new static;
}
if ($count === 1) {
return array_shift($this->items);
}
$results = [];
$collectionCount = $this->count();
@@ -1376,7 +1411,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
{
if (is_array($callback) && ! is_callable($callback)) {
return $this->sortByMany($callback);
return $this->sortByMany($callback, $options);
}
$results = [];
@@ -1407,13 +1442,14 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* Sort the collection using multiple comparisons.
*
* @param array<array-key, (callable(TValue, TValue): mixed)|(callable(TValue, TKey): mixed)|string|array{string, string}> $comparisons
* @param int $options
* @return static
*/
protected function sortByMany(array $comparisons = [])
protected function sortByMany(array $comparisons = [], int $options = SORT_REGULAR)
{
$items = $this->items;
uasort($items, function ($a, $b) use ($comparisons) {
uasort($items, function ($a, $b) use ($comparisons, $options) {
foreach ($comparisons as $comparison) {
$comparison = Arr::wrap($comparison);
@@ -1431,7 +1467,21 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
$values = array_reverse($values);
}
$result = $values[0] <=> $values[1];
if (($options & SORT_FLAG_CASE) === SORT_FLAG_CASE) {
if (($options & SORT_NATURAL) === SORT_NATURAL) {
$result = strnatcasecmp($values[0], $values[1]);
} else {
$result = strcasecmp($values[0], $values[1]);
}
} else {
$result = match ($options) {
SORT_NUMERIC => intval($values[0]) <=> intval($values[1]),
SORT_STRING => strcmp($values[0], $values[1]),
SORT_NATURAL => strnatcmp($values[0], $values[1]),
SORT_LOCALE_STRING => strcoll($values[0], $values[1]),
default => $values[0] <=> $values[1],
};
}
}
if ($result === 0) {
@@ -1454,6 +1504,16 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
*/
public function sortByDesc($callback, $options = SORT_REGULAR)
{
if (is_array($callback) && ! is_callable($callback)) {
foreach ($callback as $index => $key) {
$comparison = Arr::wrap($key);
$comparison[1] = 'desc';
$callback[$index] = $comparison;
}
}
return $this->sortBy($callback, $options, true);
}

View File

@@ -38,7 +38,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param callable|null $callback
* @return static
*/
public static function times($number, callable $callback = null);
public static function times($number, ?callable $callback = null);
/**
* Create a collection with the given range.
@@ -296,7 +296,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param (callable(TValue): bool)|null $callback
* @return static
*/
public function filter(callable $callback = null);
public function filter(?callable $callback = null);
/**
* Apply the callback if the given "value" is (or resolves to) truthy.
@@ -308,7 +308,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param (callable($this): TWhenReturnType)|null $default
* @return $this|TWhenReturnType
*/
public function when($value, callable $callback = null, callable $default = null);
public function when($value, ?callable $callback = null, ?callable $default = null);
/**
* Apply the callback if the collection is empty.
@@ -319,7 +319,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param (callable($this): TWhenEmptyReturnType)|null $default
* @return $this|TWhenEmptyReturnType
*/
public function whenEmpty(callable $callback, callable $default = null);
public function whenEmpty(callable $callback, ?callable $default = null);
/**
* Apply the callback if the collection is not empty.
@@ -330,7 +330,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param (callable($this): TWhenNotEmptyReturnType)|null $default
* @return $this|TWhenNotEmptyReturnType
*/
public function whenNotEmpty(callable $callback, callable $default = null);
public function whenNotEmpty(callable $callback, ?callable $default = null);
/**
* Apply the callback if the given "value" is (or resolves to) truthy.
@@ -342,7 +342,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param (callable($this): TUnlessReturnType)|null $default
* @return $this|TUnlessReturnType
*/
public function unless($value, callable $callback, callable $default = null);
public function unless($value, callable $callback, ?callable $default = null);
/**
* Apply the callback unless the collection is empty.
@@ -353,7 +353,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param (callable($this): TUnlessEmptyReturnType)|null $default
* @return $this|TUnlessEmptyReturnType
*/
public function unlessEmpty(callable $callback, callable $default = null);
public function unlessEmpty(callable $callback, ?callable $default = null);
/**
* Apply the callback unless the collection is not empty.
@@ -364,7 +364,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param (callable($this): TUnlessNotEmptyReturnType)|null $default
* @return $this|TUnlessNotEmptyReturnType
*/
public function unlessNotEmpty(callable $callback, callable $default = null);
public function unlessNotEmpty(callable $callback, ?callable $default = null);
/**
* Filter items by the given key value pair.
@@ -476,7 +476,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param TFirstDefault|(\Closure(): TFirstDefault) $default
* @return TValue|TFirstDefault
*/
public function first(callable $callback = null, $default = null);
public function first(?callable $callback = null, $default = null);
/**
* Get the first item by the given key value pair.
@@ -618,7 +618,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param TLastDefault|(\Closure(): TLastDefault) $default
* @return TValue|TLastDefault
*/
public function last(callable $callback = null, $default = null);
public function last(?callable $callback = null, $default = null);
/**
* Run a map over each of the items.
@@ -789,8 +789,11 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Push all of the given items onto the collection.
*
* @param iterable<array-key, TValue> $source
* @return static
* @template TConcatKey of array-key
* @template TConcatValue
*
* @param iterable<TConcatKey, TConcatValue> $source
* @return static<TKey|TConcatKey, TValue|TConcatValue>
*/
public function concat($source);

View File

@@ -428,7 +428,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* @param (callable(TValue, TKey): bool)|null $callback
* @return static
*/
public function filter(callable $callback = null)
public function filter(?callable $callback = null)
{
if (is_null($callback)) {
$callback = fn ($value) => (bool) $value;
@@ -452,7 +452,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* @param TFirstDefault|(\Closure(): TFirstDefault) $default
* @return TValue|TFirstDefault
*/
public function first(callable $callback = null, $default = null)
public function first(?callable $callback = null, $default = null)
{
$iterator = $this->getIterator();
@@ -732,7 +732,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* @param TLastDefault|(\Closure(): TLastDefault) $default
* @return TValue|TLastDefault
*/
public function last(callable $callback = null, $default = null)
public function last(?callable $callback = null, $default = null)
{
$needle = $placeholder = new stdClass;
@@ -953,11 +953,49 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
});
}
/**
* Select specific values from the items within the collection.
*
* @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey>|string $keys
* @return static
*/
public function select($keys)
{
if ($keys instanceof Enumerable) {
$keys = $keys->all();
} elseif (! is_null($keys)) {
$keys = is_array($keys) ? $keys : func_get_args();
}
return new static(function () use ($keys) {
if (is_null($keys)) {
yield from $this;
} else {
foreach ($this as $item) {
$result = [];
foreach ($keys as $key) {
if (Arr::accessible($item) && Arr::exists($item, $key)) {
$result[$key] = $item[$key];
} elseif (is_object($item) && isset($item->{$key})) {
$result[$key] = $item->{$key};
}
}
yield $result;
}
}
});
}
/**
* Push all of the given items onto the collection.
*
* @param iterable<array-key, TValue> $source
* @return static
* @template TConcatKey of array-key
* @template TConcatValue
*
* @param iterable<TConcatKey, TConcatValue> $source
* @return static<TKey|TConcatKey, TValue|TConcatValue>
*/
public function concat($source)
{

View File

@@ -164,7 +164,7 @@ trait EnumeratesValues
* @param (callable(int): TTimesValue)|null $callback
* @return static<int, TTimesValue>
*/
public static function times($number, callable $callback = null)
public static function times($number, ?callable $callback = null)
{
if ($number < 1) {
return new static;
@@ -534,7 +534,7 @@ trait EnumeratesValues
* @param (callable($this): TWhenEmptyReturnType)|null $default
* @return $this|TWhenEmptyReturnType
*/
public function whenEmpty(callable $callback, callable $default = null)
public function whenEmpty(callable $callback, ?callable $default = null)
{
return $this->when($this->isEmpty(), $callback, $default);
}
@@ -548,7 +548,7 @@ trait EnumeratesValues
* @param (callable($this): TWhenNotEmptyReturnType)|null $default
* @return $this|TWhenNotEmptyReturnType
*/
public function whenNotEmpty(callable $callback, callable $default = null)
public function whenNotEmpty(callable $callback, ?callable $default = null)
{
return $this->when($this->isNotEmpty(), $callback, $default);
}
@@ -562,7 +562,7 @@ trait EnumeratesValues
* @param (callable($this): TUnlessEmptyReturnType)|null $default
* @return $this|TUnlessEmptyReturnType
*/
public function unlessEmpty(callable $callback, callable $default = null)
public function unlessEmpty(callable $callback, ?callable $default = null)
{
return $this->whenNotEmpty($callback, $default);
}
@@ -576,7 +576,7 @@ trait EnumeratesValues
* @param (callable($this): TUnlessNotEmptyReturnType)|null $default
* @return $this|TUnlessNotEmptyReturnType
*/
public function unlessNotEmpty(callable $callback, callable $default = null)
public function unlessNotEmpty(callable $callback, ?callable $default = null)
{
return $this->whenEmpty($callback, $default);
}

View File

@@ -18,7 +18,7 @@ trait Conditionable
* @param (callable($this, TWhenParameter): TWhenReturnType)|null $default
* @return $this|TWhenReturnType
*/
public function when($value = null, callable $callback = null, callable $default = null)
public function when($value = null, ?callable $callback = null, ?callable $default = null)
{
$value = $value instanceof Closure ? $value($this) : $value;
@@ -50,7 +50,7 @@ trait Conditionable
* @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $default
* @return $this|TUnlessReturnType
*/
public function unless($value = null, callable $callback = null, callable $default = null)
public function unless($value = null, ?callable $callback = null, ?callable $default = null)
{
$value = $value instanceof Closure ? $value($this) : $value;

0
vendor/laravel/framework/src/Illuminate/Config/composer.json vendored Normal file → Executable file
View File

4
vendor/laravel/framework/src/Illuminate/Console/Application.php vendored Normal file → Executable file
View File

@@ -237,7 +237,9 @@ class Application extends SymfonyApplication implements ApplicationContract
public function resolve($command)
{
if (is_subclass_of($command, SymfonyCommand::class) && ($commandName = $command::getDefaultName())) {
$this->commandMap[$commandName] = $command;
foreach (explode('|', $commandName) as $name) {
$this->commandMap[$name] = $command;
}
return null;
}

10
vendor/laravel/framework/src/Illuminate/Console/Command.php vendored Normal file → Executable file
View File

@@ -236,11 +236,13 @@ class Command extends SymfonyCommand
*/
protected function resolveCommand($command)
{
if (! class_exists($command)) {
return $this->getApplication()->find($command);
}
if (is_string($command)) {
if (! class_exists($command)) {
return $this->getApplication()->find($command);
}
$command = $this->laravel->make($command);
$command = $this->laravel->make($command);
}
if ($command instanceof SymfonyCommand) {
$command->setApplication($this->getApplication());

View File

@@ -17,7 +17,9 @@ trait InteractsWithSignals
/**
* Define a callback to be run when the given signal(s) occurs.
*
* @param iterable<array-key, int>|int $signals
* @template TSignals of iterable<array-key, int>|int
*
* @param (\Closure():(TSignals))|TSignals $signals
* @param callable(int $signal): void $callback
* @return void
*/
@@ -28,7 +30,7 @@ trait InteractsWithSignals
$this->getApplication()->getSignalRegistry(),
);
collect(Arr::wrap($signals))
collect(Arr::wrap(value($signals)))
->each(fn ($signal) => $this->signals->register($signal, $callback));
});
}

View File

@@ -84,6 +84,7 @@ abstract class GeneratorCommand extends Command implements PromptsForMissingInpu
'namespace',
'new',
'or',
'parent',
'print',
'private',
'protected',

View File

@@ -32,9 +32,9 @@ class CommandBuilder
{
$output = ProcessUtils::escapeArgument($event->output);
return $this->ensureCorrectUser(
$event, $event->command.($event->shouldAppendOutput ? ' >> ' : ' > ').$output.' 2>&1'
);
return laravel_cloud()
? $this->ensureCorrectUser($event, $event->command.' 2>&1 | tee '.($event->shouldAppendOutput ? '-a ' : '').$output)
: $this->ensureCorrectUser($event, $event->command.($event->shouldAppendOutput ? ' >> ' : ' > ').$output.' 2>&1');
}
/**

View File

@@ -289,7 +289,11 @@ class Event
{
return Process::fromShellCommandline(
$this->buildCommand(), base_path(), null, null, null
)->run();
)->run(
laravel_cloud()
? fn ($type, $line) => fwrite($type === 'out' ? STDOUT : STDERR, $line)
: fn () => true
);
}
/**

View File

@@ -112,12 +112,14 @@ class ScheduleRunCommand extends Command
$this->handler = $handler;
$this->phpBinary = Application::phpBinary();
$this->clearInterruptSignal();
$this->newLine();
$events = $this->schedule->dueEvents($this->laravel);
if ($events->contains->isRepeatable()) {
$this->clearInterruptSignal();
}
foreach ($events as $event) {
if (! $event->filtersPass($this->laravel)) {
$this->dispatcher->dispatch(new ScheduledTaskSkipped($event));
@@ -271,7 +273,7 @@ class ScheduleRunCommand extends Command
/**
* Ensure the interrupt signal is cleared.
*
* @return bool
* @return void
*/
protected function clearInterruptSignal()
{

0
vendor/laravel/framework/src/Illuminate/Console/composer.json vendored Normal file → Executable file
View File

8
vendor/laravel/framework/src/Illuminate/Container/Container.php vendored Normal file → Executable file
View File

@@ -1148,7 +1148,7 @@ class Container implements ArrayAccess, ContainerContract
* @param \Closure|null $callback
* @return void
*/
public function beforeResolving($abstract, Closure $callback = null)
public function beforeResolving($abstract, ?Closure $callback = null)
{
if (is_string($abstract)) {
$abstract = $this->getAlias($abstract);
@@ -1168,7 +1168,7 @@ class Container implements ArrayAccess, ContainerContract
* @param \Closure|null $callback
* @return void
*/
public function resolving($abstract, Closure $callback = null)
public function resolving($abstract, ?Closure $callback = null)
{
if (is_string($abstract)) {
$abstract = $this->getAlias($abstract);
@@ -1188,7 +1188,7 @@ class Container implements ArrayAccess, ContainerContract
* @param \Closure|null $callback
* @return void
*/
public function afterResolving($abstract, Closure $callback = null)
public function afterResolving($abstract, ?Closure $callback = null)
{
if (is_string($abstract)) {
$abstract = $this->getAlias($abstract);
@@ -1427,7 +1427,7 @@ class Container implements ArrayAccess, ContainerContract
* @param \Illuminate\Contracts\Container\Container|null $container
* @return \Illuminate\Contracts\Container\Container|static
*/
public static function setInstance(ContainerContract $container = null)
public static function setInstance(?ContainerContract $container = null)
{
return static::$instance = $container;
}

0
vendor/laravel/framework/src/Illuminate/Container/composer.json vendored Normal file → Executable file
View File

View File

@@ -29,7 +29,7 @@ interface Gate
* @param array|null $abilities
* @return $this
*/
public function resource($name, $class, array $abilities = null);
public function resource($name, $class, ?array $abilities = null);
/**
* Define a policy class for a given class type.

View File

@@ -48,7 +48,7 @@ interface PasswordBroker
* @param \Closure|null $callback
* @return string
*/
public function sendResetLink(array $credentials, Closure $callback = null);
public function sendResetLink(array $credentials, ?Closure $callback = null);
/**
* Reset the password for the given token.

View File

@@ -197,7 +197,7 @@ interface Container extends ContainerInterface
* @param \Closure|null $callback
* @return void
*/
public function beforeResolving($abstract, Closure $callback = null);
public function beforeResolving($abstract, ?Closure $callback = null);
/**
* Register a new resolving callback.
@@ -206,7 +206,7 @@ interface Container extends ContainerInterface
* @param \Closure|null $callback
* @return void
*/
public function resolving($abstract, Closure $callback = null);
public function resolving($abstract, ?Closure $callback = null);
/**
* Register a new after resolving callback.
@@ -215,5 +215,5 @@ interface Container extends ContainerInterface
* @param \Closure|null $callback
* @return void
*/
public function afterResolving($abstract, Closure $callback = null);
public function afterResolving($abstract, ?Closure $callback = null);
}

View File

@@ -60,5 +60,5 @@ interface InvokedProcess
* @param callable|null $output
* @return \Illuminate\Console\Process\ProcessResult
*/
public function wait(callable $output = null);
public function wait(?callable $output = null);
}

View File

@@ -52,7 +52,7 @@ interface ProcessResult
* @param callable|null $callback
* @return $this
*/
public function throw(callable $callback = null);
public function throw(?callable $callback = null);
/**
* Throw an exception if the process failed and the given condition is true.
@@ -61,5 +61,5 @@ interface ProcessResult
* @param callable|null $callback
* @return $this
*/
public function throwIf(bool $condition, callable $callback = null);
public function throwIf(bool $condition, ?callable $callback = null);
}

View File

View File

View File

View File

View File

0
vendor/laravel/framework/src/Illuminate/Contracts/View/Engine.php vendored Normal file → Executable file
View File

0
vendor/laravel/framework/src/Illuminate/Cookie/CookieJar.php vendored Normal file → Executable file
View File

View File

0
vendor/laravel/framework/src/Illuminate/Cookie/composer.json vendored Normal file → Executable file
View File

View File

@@ -27,7 +27,7 @@ class Manager
* @param \Illuminate\Container\Container|null $container
* @return void
*/
public function __construct(Container $container = null)
public function __construct(?Container $container = null)
{
$this->setupContainer($container ?: new Container);

View File

@@ -379,11 +379,14 @@ trait BuildsQueries
$orders = $this->ensureOrderForCursorPagination(! is_null($cursor) && $cursor->pointsToPreviousItems());
if (! is_null($cursor)) {
$addCursorConditions = function (self $builder, $previousColumn, $i) use (&$addCursorConditions, $cursor, $orders) {
$unionBuilders = isset($builder->unions) ? collect($builder->unions)->pluck('query') : collect();
// Reset the union bindings so we can add the cursor where in the correct position...
$this->setBindings([], 'union');
$addCursorConditions = function (self $builder, $previousColumn, $originalColumn, $i) use (&$addCursorConditions, $cursor, $orders) {
$unionBuilders = $builder->getUnionBuilders();
if (! is_null($previousColumn)) {
$originalColumn = $this->getOriginalColumnNameForCursorPagination($this, $previousColumn);
$originalColumn ??= $this->getOriginalColumnNameForCursorPagination($this, $previousColumn);
$builder->where(
Str::contains($originalColumn, ['(', ')']) ? new Expression($originalColumn) : $originalColumn,
@@ -393,7 +396,7 @@ trait BuildsQueries
$unionBuilders->each(function ($unionBuilder) use ($previousColumn, $cursor) {
$unionBuilder->where(
$this->getOriginalColumnNameForCursorPagination($this, $previousColumn),
$this->getOriginalColumnNameForCursorPagination($unionBuilder, $previousColumn),
'=',
$cursor->parameter($previousColumn)
);
@@ -402,44 +405,48 @@ trait BuildsQueries
});
}
$builder->where(function (self $builder) use ($addCursorConditions, $cursor, $orders, $i, $unionBuilders) {
$builder->where(function (self $secondBuilder) use ($addCursorConditions, $cursor, $orders, $i, $unionBuilders) {
['column' => $column, 'direction' => $direction] = $orders[$i];
$originalColumn = $this->getOriginalColumnNameForCursorPagination($this, $column);
$builder->where(
$secondBuilder->where(
Str::contains($originalColumn, ['(', ')']) ? new Expression($originalColumn) : $originalColumn,
$direction === 'asc' ? '>' : '<',
$cursor->parameter($column)
);
if ($i < $orders->count() - 1) {
$builder->orWhere(function (self $builder) use ($addCursorConditions, $column, $i) {
$addCursorConditions($builder, $column, $i + 1);
$secondBuilder->orWhere(function (self $thirdBuilder) use ($addCursorConditions, $column, $originalColumn, $i) {
$addCursorConditions($thirdBuilder, $column, $originalColumn, $i + 1);
});
}
$unionBuilders->each(function ($unionBuilder) use ($column, $direction, $cursor, $i, $orders, $addCursorConditions) {
$unionBuilder->where(function ($unionBuilder) use ($column, $direction, $cursor, $i, $orders, $addCursorConditions) {
$unionWheres = $unionBuilder->getRawBindings()['where'];
$originalColumn = $this->getOriginalColumnNameForCursorPagination($unionBuilder, $column);
$unionBuilder->where(function ($unionBuilder) use ($column, $direction, $cursor, $i, $orders, $addCursorConditions, $originalColumn, $unionWheres) {
$unionBuilder->where(
$this->getOriginalColumnNameForCursorPagination($this, $column),
$originalColumn,
$direction === 'asc' ? '>' : '<',
$cursor->parameter($column)
);
if ($i < $orders->count() - 1) {
$unionBuilder->orWhere(function (self $builder) use ($addCursorConditions, $column, $i) {
$addCursorConditions($builder, $column, $i + 1);
$unionBuilder->orWhere(function (self $fourthBuilder) use ($addCursorConditions, $column, $originalColumn, $i) {
$addCursorConditions($fourthBuilder, $column, $originalColumn, $i + 1);
});
}
$this->addBinding($unionWheres, 'union');
$this->addBinding($unionBuilder->getRawBindings()['where'], 'union');
});
});
});
};
$addCursorConditions($this, null, 0);
$addCursorConditions($this, null, null, 0);
}
$this->limit($perPage + 1);

View File

@@ -41,22 +41,15 @@ trait ManagesTransactions
continue;
}
$levelBeingCommitted = $this->transactions;
try {
if ($this->transactions == 1) {
$this->fireConnectionEvent('committing');
$this->getPdo()->commit();
}
[$levelBeingCommitted, $this->transactions] = [
$this->transactions,
max(0, $this->transactions - 1),
];
$this->transactionsManager?->commit(
$this->getName(),
$levelBeingCommitted,
$this->transactions
);
$this->transactions = max(0, $this->transactions - 1);
} catch (Throwable $e) {
$this->handleCommitTransactionException(
$e, $currentAttempt, $attempts
@@ -65,6 +58,12 @@ trait ManagesTransactions
continue;
}
$this->transactionsManager?->commit(
$this->getName(),
$levelBeingCommitted,
$this->transactions
);
$this->fireConnectionEvent('committed');
return $callbackResult;
@@ -119,6 +118,10 @@ trait ManagesTransactions
*/
public function beginTransaction()
{
foreach ($this->beforeStartingTransaction as $callback) {
$callback($this);
}
$this->createTransaction();
$this->transactions++;

20
vendor/laravel/framework/src/Illuminate/Database/Connection.php vendored Normal file → Executable file
View File

@@ -182,6 +182,13 @@ class Connection implements ConnectionInterface
*/
protected $pretending = false;
/**
* All of the callbacks that should be invoked before a transaction is started.
*
* @var \Closure[]
*/
protected $beforeStartingTransaction = [];
/**
* All of the callbacks that should be invoked before a query is executed.
*
@@ -1021,6 +1028,19 @@ class Connection implements ConnectionInterface
$this->doctrineConnection = null;
}
/**
* Register a hook to be run just before a database transaction is started.
*
* @param \Closure $callback
* @return $this
*/
public function beforeStartingTransaction(Closure $callback)
{
$this->beforeStartingTransaction[] = $callback;
return $this;
}
/**
* Register a hook to be run just before a database query is executed.
*

View File

View File

View File

View File

View File

View File

View File

View File

@@ -38,8 +38,6 @@ class PostgresConnector extends Connector implements ConnectorInterface
$this->configureIsolationLevel($connection, $config);
$this->configureEncoding($connection, $config);
// Next, we will check to see if a timezone has been specified in this config
// and if it has we will issue a statement to modify the timezone with the
// database. Setting this DB timezone is an optional configuration item.
@@ -47,11 +45,6 @@ class PostgresConnector extends Connector implements ConnectorInterface
$this->configureSearchPath($connection, $config);
// Postgres allows an application_name to be set by the user and this name is
// used to when monitoring the application with pg_stat_activity. So we'll
// determine if the option has been specified and run a statement if so.
$this->configureApplicationName($connection, $config);
$this->configureSynchronousCommit($connection, $config);
return $connection;
@@ -71,22 +64,6 @@ class PostgresConnector extends Connector implements ConnectorInterface
}
}
/**
* Set the connection character set and collation.
*
* @param \PDO $connection
* @param array $config
* @return void
*/
protected function configureEncoding($connection, $config)
{
if (! isset($config['charset'])) {
return;
}
$connection->prepare("set names '{$config['charset']}'")->execute();
}
/**
* Set the timezone on the connection.
*
@@ -132,22 +109,6 @@ class PostgresConnector extends Connector implements ConnectorInterface
return count($searchPath) === 1 ? '"'.$searchPath[0].'"' : '"'.implode('", "', $searchPath).'"';
}
/**
* Set the application name on the connection.
*
* @param \PDO $connection
* @param array $config
* @return void
*/
protected function configureApplicationName($connection, $config)
{
if (isset($config['application_name'])) {
$applicationName = $config['application_name'];
$connection->prepare("set application_name to '$applicationName'")->execute();
}
}
/**
* Create a DSN string from a configuration.
*
@@ -178,6 +139,17 @@ class PostgresConnector extends Connector implements ConnectorInterface
$dsn .= ";port={$port}";
}
if (isset($charset)) {
$dsn .= ";client_encoding='{$charset}'";
}
// Postgres allows an application_name to be set by the user and this name is
// used to when monitoring the application with pg_stat_activity. So we'll
// determine if the option has been specified and run a statement if so.
if (isset($application_name)) {
$dsn .= ";application_name='".str_replace("'", "\'", $application_name)."'";
}
return $this->addSslOptions($dsn, $config);
}

View File

View File

View File

@@ -54,7 +54,7 @@ abstract class DatabaseInspectionCommand extends Command
* @param \Illuminate\Support\Composer|null $composer
* @return void
*/
public function __construct(Composer $composer = null)
public function __construct(?Composer $composer = null)
{
parent::__construct();

View File

@@ -192,6 +192,7 @@ class DbCommand extends Command
'password' => ['-P', $connection['password']],
'host' => ['-S', 'tcp:'.$connection['host']
.($connection['port'] ? ','.$connection['port'] : ''), ],
'trust_server_certificate' => ['-C'],
], $connection));
}

View File

View File

View File

@@ -4,13 +4,17 @@ namespace Illuminate\Database\DBAL;
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MariaDb1010Platform;
use Doctrine\DBAL\Platforms\MariaDb1027Platform;
use Doctrine\DBAL\Platforms\MariaDb1052Platform;
use Doctrine\DBAL\Platforms\MariaDb1060Platform;
use Doctrine\DBAL\Platforms\MariaDBPlatform;
use Doctrine\DBAL\Platforms\MySQL57Platform;
use Doctrine\DBAL\Platforms\MySQL80Platform;
use Doctrine\DBAL\Platforms\MySQL84Platform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
use Doctrine\DBAL\Platforms\PostgreSQL120Platform;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
@@ -32,12 +36,16 @@ class TimestampType extends Type implements PhpDateTimeMappingType
MySQLPlatform::class,
MySQL57Platform::class,
MySQL80Platform::class,
MySQL84Platform::class,
MariaDBPlatform::class,
MariaDb1027Platform::class,
MariaDb1052Platform::class, => $this->getMySqlPlatformSQLDeclaration($column),
MariaDb1052Platform::class,
MariaDb1060Platform::class,
MariaDb1010Platform::class => $this->getMySqlPlatformSQLDeclaration($column),
PostgreSQLPlatform::class,
PostgreSQL94Platform::class,
PostgreSQL100Platform::class => $this->getPostgresPlatformSQLDeclaration($column),
PostgreSQL100Platform::class,
PostgreSQL120Platform::class => $this->getPostgresPlatformSQLDeclaration($column),
SQLServerPlatform::class,
SQLServer2012Platform::class => $this->getSqlServerPlatformSQLDeclaration($column),
SqlitePlatform::class => 'DATETIME',

View File

Some files were not shown because too many files have changed in this diff Show More