Skip to content

Commit 6758bc0

Browse files
committed
Merge branch '10.x' of github.com:laravel/framework into 10.x
2 parents 31713b3 + fc70c5e commit 6758bc0

25 files changed

+369
-47
lines changed

.github/workflows/releases.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,16 @@ jobs:
2727
- name: Remove optional "v" prefix
2828
id: version
2929
run: |
30-
VERSION=${{ inputs.version }}
3130
echo "version=${VERSION#v}" >> "$GITHUB_OUTPUT"
31+
env:
32+
VERSION: ${{ inputs.version }}
3233

3334
- name: Check if branch and version match
3435
id: guard
3536
run: |
3637
MAJOR_VERSION="${NUMERIC_VERSION%%.*}"
3738
BRANCH_MAJOR_VERSION="${BRANCH%%.*}"
3839
39-
echo "MAJOR_VERSION=$(echo $MAJOR_VERSION)" >> $GITHUB_OUTPUT;
40-
echo "BRANCH_MAJOR_VERSION=$(echo $BRANCH_MAJOR_VERSION)" >> $GITHUB_OUTPUT;
41-
4240
if [ "$MAJOR_VERSION" != "$BRANCH_MAJOR_VERSION" ]; then
4341
echo "Mismatched versions! Aborting."
4442
VERSION_MISMATCH='true';
@@ -47,7 +45,7 @@ jobs:
4745
VERSION_MISMATCH='false';
4846
fi
4947
50-
echo "VERSION_MISMATCH=$(echo $VERSION_MISMATCH)" >> $GITHUB_OUTPUT;
48+
echo "VERSION_MISMATCH=$(echo $VERSION_MISMATCH)" >> "$GITHUB_OUTPUT";
5149
env:
5250
BRANCH: ${{ github.ref_name }}
5351
NUMERIC_VERSION: ${{ steps.version.outputs.version }}
@@ -90,9 +88,30 @@ jobs:
9088
- name: Cleanup release notes
9189
id: cleaned-notes
9290
run: |
93-
RELEASE_NOTES=$(echo $RELEASE_NOTES | sed '/## What/d')
94-
RELEASE_NOTES=$(echo $RELEASE_NOTES | sed '/## New Contributors/,$d')
95-
echo "notes=${RELEASE_NOTES}" >> "$GITHUB_OUTPUT"
91+
START_FROM=$(echo -n "$RELEASE_NOTES" | awk "/What's Changed/{ print NR; exit }" -)
92+
DROP_FROM_CONTRIBUTORS=$(echo -n "$RELEASE_NOTES" | awk "/New Contributors/{ print NR; exit }" -)
93+
DROP_FROM_FULL_CHANGELOG=$(echo -n "$RELEASE_NOTES" | awk "/Full Changelog/{ print NR; exit }" -)
94+
95+
# Drop everything starting from "Full Changelog"
96+
if [ ! -z "$DROP_FROM_FULL_CHANGELOG" ]; then
97+
RELEASE_NOTES=$(echo -n "$RELEASE_NOTES" | sed "${DROP_FROM_FULL_CHANGELOG},$ d")
98+
fi
99+
100+
# Drop everything starting from "New Contributors"
101+
if [ ! -z "$DROP_FROM_CONTRIBUTORS" ]; then
102+
RELEASE_NOTES=$(echo -n "$RELEASE_NOTES" | sed "${DROP_FROM_CONTRIBUTORS},$ d")
103+
fi
104+
105+
# Drop the line "What's Changed"
106+
if [ ! -z "$START_FROM" ]; then
107+
RELEASE_NOTES=$(echo -n "$RELEASE_NOTES" | sed "${START_FROM}d")
108+
fi
109+
110+
{
111+
echo 'notes<<EOF'
112+
echo "$RELEASE_NOTES"
113+
echo EOF
114+
} >> "$GITHUB_OUTPUT";
96115
env:
97116
RELEASE_NOTES: ${{ steps.generated-notes.outputs.release-notes }}
98117

@@ -105,7 +124,7 @@ jobs:
105124
name: v${{ steps.version.outputs.version }}
106125
body: ${{ steps.cleaned-notes.outputs.notes }}
107126
target_commitish: ${{ github.ref_name }}
108-
make_latest: 'legacy'
127+
make_latest: "${{ github.ref_name == github.event.repository.default_branch }}"
109128

110129
update-changelog:
111130
needs: release

CHANGELOG.md

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

3-
## [Unreleased](https://github.com/laravel/framework/compare/v10.48.10...10.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v10.48.15...10.x)
4+
5+
## [v10.48.15](https://github.com/laravel/framework/compare/v10.48.14...v10.48.15) - 2024-07-02
6+
7+
* [10.x] Set previous exception on `HttpResponseException` by [@hafezdivandari](https://github.com/hafezdivandari) in https://github.com/laravel/framework/pull/51986
8+
9+
## [v10.48.14](https://github.com/laravel/framework/compare/v10.48.13...v10.48.14) - 2024-06-21
10+
11+
* [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
12+
* [10.x] fix handle `shift()` on an empty collection by [@Treggats](https://github.com/Treggats) in https://github.com/laravel/framework/pull/51841
13+
* [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
14+
15+
## [v10.48.13](https://github.com/laravel/framework/compare/v10.48.12...v10.48.13) - 2024-06-18
16+
17+
* [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
18+
* [10.x] Fix collection shift less than one item by [@faissaloux](https://github.com/faissaloux) in https://github.com/laravel/framework/pull/51686
19+
* [10.x] Turn `Enumerable unless()` $callback parameter optional by [@faissaloux](https://github.com/faissaloux) in https://github.com/laravel/framework/pull/51701
20+
* Revert "[10.x] Turn `Enumerable unless()` $callback parameter optional" by [@taylorotwell](https://github.com/taylorotwell) in https://github.com/laravel/framework/pull/51707
21+
22+
## [v10.48.12](https://github.com/laravel/framework/compare/v10.48.11...v10.48.12) - 2024-05-28
23+
24+
* [10.x] Fix typo by [@Issei0804-ie](https://github.com/Issei0804-ie) in https://github.com/laravel/framework/pull/51535
25+
* [10.x] Fix SQL Server detection in database store by [@staudenmeir](https://github.com/staudenmeir) in https://github.com/laravel/framework/pull/51547
26+
* [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
27+
* [10.x] Fixes explicit route binding with `BackedEnum` by [@CAAHS](https://github.com/CAAHS) in https://github.com/laravel/framework/pull/51586
28+
29+
## [v10.48.11](https://github.com/laravel/framework/compare/v10.48.10...v10.48.11) - 2024-05-21
30+
31+
* [10.x] Backport: Fix SesV2Transport to use correct `EmailTags` argument by [@Tietew](https://github.com/Tietew) in https://github.com/laravel/framework/pull/51352
32+
* [10.x] Fix PHPDoc typo by [@staudenmeir](https://github.com/staudenmeir) in https://github.com/laravel/framework/pull/51390
33+
* [10.x] Fix `apa` on non ASCII characters by [@faissaloux](https://github.com/faissaloux) in https://github.com/laravel/framework/pull/51428
34+
* [10.x] Fixes view engine resolvers leaking memory by [@nunomaduro](https://github.com/nunomaduro) in https://github.com/laravel/framework/pull/51450
35+
* [10.x] Do not use `app()` Foundation helper on `ViewServiceProvider` by [@rodrigopedra](https://github.com/rodrigopedra) in https://github.com/laravel/framework/pull/51522
436

537
## [v10.48.10](https://github.com/laravel/framework/compare/v10.48.9...v10.48.10) - 2024-04-30
638

RELEASE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release Instructions
2+
3+
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.
4+
5+
<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">

src/Illuminate/Bus/DatabaseBatchRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
use Closure;
77
use DateTimeInterface;
88
use Illuminate\Database\Connection;
9-
use Illuminate\Database\Eloquent\ModelNotFoundException;
109
use Illuminate\Database\PostgresConnection;
1110
use Illuminate\Database\Query\Expression;
1211
use Illuminate\Support\Str;
12+
use Throwable;
1313

1414
class DatabaseBatchRepository implements PrunableBatchRepository
1515
{
@@ -352,7 +352,7 @@ protected function unserialize($serialized)
352352

353353
try {
354354
return unserialize($serialized);
355-
} catch (ModelNotFoundException) {
355+
} catch (Throwable) {
356356
return [];
357357
}
358358
}

src/Illuminate/Cache/DatabaseStore.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ public function add($key, $value, $seconds)
158158
$value = $this->serialize($value);
159159
$expiration = $this->getTime() + $seconds;
160160

161-
$doesntSupportInsertOrIgnore = [SqlServerConnection::class];
162-
163-
if (! in_array(get_class($this->getConnection()), $doesntSupportInsertOrIgnore)) {
161+
if (! $this->getConnection() instanceof SqlServerConnection) {
164162
return $this->table()->insertOrIgnore(compact('key', 'value', 'expiration')) > 0;
165163
}
166164

src/Illuminate/Collections/Collection.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString;
88
use Illuminate\Support\Traits\EnumeratesValues;
99
use Illuminate\Support\Traits\Macroable;
10+
use InvalidArgumentException;
1011
use stdClass;
1112
use Traversable;
1213

@@ -1124,17 +1125,27 @@ public function search($value, $strict = false)
11241125
*
11251126
* @param int $count
11261127
* @return static<int, TValue>|TValue|null
1128+
*
1129+
* @throws \InvalidArgumentException
11271130
*/
11281131
public function shift($count = 1)
11291132
{
1130-
if ($count === 1) {
1131-
return array_shift($this->items);
1133+
if ($count < 0) {
1134+
throw new InvalidArgumentException('Number of shifted items may not be less than zero.');
11321135
}
11331136

11341137
if ($this->isEmpty()) {
1138+
return null;
1139+
}
1140+
1141+
if ($count === 0) {
11351142
return new static;
11361143
}
11371144

1145+
if ($count === 1) {
1146+
return array_shift($this->items);
1147+
}
1148+
11381149
$results = [];
11391150

11401151
$collectionCount = $this->count();

src/Illuminate/Console/Command.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,13 @@ protected function commandIsolationMutex()
236236
*/
237237
protected function resolveCommand($command)
238238
{
239-
if (! class_exists($command)) {
240-
return $this->getApplication()->find($command);
241-
}
239+
if (is_string($command)) {
240+
if (! class_exists($command)) {
241+
return $this->getApplication()->find($command);
242+
}
242243

243-
$command = $this->laravel->make($command);
244+
$command = $this->laravel->make($command);
245+
}
244246

245247
if ($command instanceof SymfonyCommand) {
246248
$command->setApplication($this->getApplication());

src/Illuminate/Database/Schema/MySqlSchemaState.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public function dump(Connection $connection, $path)
2626

2727
$this->removeAutoIncrementingState($path);
2828

29-
$this->appendMigrationData($path);
29+
if ($this->hasMigrationTable()) {
30+
$this->appendMigrationData($path);
31+
}
3032
}
3133

3234
/**

src/Illuminate/Database/Schema/PostgresSchemaState.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ public function dump(Connection $connection, $path)
1717
{
1818
$commands = collect([
1919
$this->baseDumpCommand().' --schema-only > '.$path,
20-
$this->baseDumpCommand().' -t '.$this->migrationTable.' --data-only >> '.$path,
2120
]);
2221

22+
if ($this->hasMigrationTable()) {
23+
$commands->push($this->baseDumpCommand().' -t '.$this->migrationTable.' --data-only >> '.$path);
24+
}
25+
2326
$commands->map(function ($command, $path) {
2427
$this->makeProcess($command)->mustRun($this->output, array_merge($this->baseVariables($this->connection->getConfig()), [
2528
'LARAVEL_LOAD_PATH' => $path,

src/Illuminate/Database/Schema/SchemaState.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ public function makeProcess(...$arguments)
9494
return call_user_func($this->processFactory, ...$arguments);
9595
}
9696

97+
/**
98+
* Determine if the current connection has a migration table.
99+
*
100+
* @return bool
101+
*/
102+
public function hasMigrationTable(): bool
103+
{
104+
return $this->connection->getSchemaBuilder()->hasTable($this->migrationTable);
105+
}
106+
97107
/**
98108
* Specify the name of the application's migration table.
99109
*

0 commit comments

Comments
 (0)