Skip to content

Commit 777abe0

Browse files
committed
Merge tag 'v12.19.3'
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
2 parents 37a74cd + 4e6ec68 commit 777abe0

39 files changed

+658
-135
lines changed

CHANGELOG.md

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

3-
## [Unreleased](https://github.com/laravel/framework/compare/v12.18.0...12.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v12.19.2...12.x)
4+
5+
## [v12.19.2](https://github.com/laravel/framework/compare/v12.19.1...v12.19.2) - 2025-06-17
6+
7+
## [v12.19.1](https://github.com/laravel/framework/compare/v12.19.0...v12.19.1) - 2025-06-17
8+
9+
* Revert "[12.x] Check if file exists before trying to delete it" by [@GrahamCampbell](https://github.com/GrahamCampbell) in https://github.com/laravel/framework/pull/56072
10+
11+
## [v12.19.0](https://github.com/laravel/framework/compare/v12.18.0...v12.19.0) - 2025-06-17
12+
13+
* [11.x] Fix validation to not throw incompatible validation exception by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/55963
14+
* [12.x] Correct testEncryptAndDecrypt to properly test new methods by [@KIKOmanasijev](https://github.com/KIKOmanasijev) in https://github.com/laravel/framework/pull/55985
15+
* [12.x] Check if file exists before trying to delete it by [@Jellyfrog](https://github.com/Jellyfrog) in https://github.com/laravel/framework/pull/55994
16+
* Clear cast caches when discarding changes by [@willtj](https://github.com/willtj) in https://github.com/laravel/framework/pull/55992
17+
* [12.x] Handle Null Check in Str::contains by [@Jellyfrog](https://github.com/Jellyfrog) in https://github.com/laravel/framework/pull/55991
18+
* [12.x] Remove call to deprecated `getDefaultDescription` method by [@jnoordsij](https://github.com/jnoordsij) in https://github.com/laravel/framework/pull/55990
19+
* Bump brace-expansion from 2.0.1 to 2.0.2 in /src/Illuminate/Foundation/resources/exceptions/renderer by [@dependabot](https://github.com/dependabot) in https://github.com/laravel/framework/pull/55999
20+
* Enhance error handling in PendingRequest to convert TooManyRedirectsE… by [@achrafAa](https://github.com/achrafAa) in https://github.com/laravel/framework/pull/55998
21+
* [12.x] fix: remove Model intersection from UserProvider contract by [@calebdw](https://github.com/calebdw) in https://github.com/laravel/framework/pull/56013
22+
* [12.x] Remove the only [@return](https://github.com/return) tag left on a constructor by [@JordanchoEftimov](https://github.com/JordanchoEftimov) in https://github.com/laravel/framework/pull/56001
23+
* [12.x] Introduce `ComputesOnceableHashInterface` by [@Jacobs63](https://github.com/Jacobs63) in https://github.com/laravel/framework/pull/56009
24+
* [12.x] Add assertRedirectBackWithErrors to TestResponse by [@AhmedAlaa4611](https://github.com/AhmedAlaa4611) in https://github.com/laravel/framework/pull/55987
25+
* [12.x] collapseWithKeys - Prevent exception in base case by [@DeanWunder](https://github.com/DeanWunder) in https://github.com/laravel/framework/pull/56002
26+
* [12.x] Standardize size() behavior and add extended queue metrics support by [@sylvesterdamgaard](https://github.com/sylvesterdamgaard) in https://github.com/laravel/framework/pull/56010
27+
* [11.x] Fix `symfony/console:7.4` compatibility by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/56015
28+
* [12.x] Improve constructor PHPDoc for controller middleware definition by [@JordanchoEftimov](https://github.com/JordanchoEftimov) in https://github.com/laravel/framework/pull/56021
29+
* Remove `@return` tags from constructors by [@michaelnabil230](https://github.com/michaelnabil230) in https://github.com/laravel/framework/pull/56024
30+
* [12.x] sort helper functions in alphabetic order by [@gigabites19](https://github.com/gigabites19) in https://github.com/laravel/framework/pull/56031
31+
* [12.x] add Attachment::fromUploadedFile method by [@rodrigopedra](https://github.com/rodrigopedra) in https://github.com/laravel/framework/pull/56027
32+
* [12.x]: Add UseEloquentBuilder attribute to register custom Eloquent Builder by [@KIKOmanasijev](https://github.com/KIKOmanasijev) in https://github.com/laravel/framework/pull/56025
33+
* [12.x] Improve PHPDoc for the Illuminate\Cache folder files by [@JordanchoEftimov](https://github.com/JordanchoEftimov) in https://github.com/laravel/framework/pull/56028
34+
* [12.x] Add a new model cast named asFluent by [@azim-kordpour](https://github.com/azim-kordpour) in https://github.com/laravel/framework/pull/56046
35+
* [12.x] Introduce `FailOnException` job middleware by [@cosmastech](https://github.com/cosmastech) in https://github.com/laravel/framework/pull/56037
36+
* [12.x] isSoftDeletable(), isPrunable(), and isMassPrunable() to model class by [@shaedrich](https://github.com/shaedrich) in https://github.com/laravel/framework/pull/56060
437

538
## [v12.18.0](https://github.com/laravel/framework/compare/v12.17.0...v12.18.0) - 2025-06-10
639

src/Illuminate/Cache/ArrayLock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function release()
8282
/**
8383
* Returns the owner value written into the driver for this lock.
8484
*
85-
* @return string
85+
* @return string|null
8686
*/
8787
protected function getCurrentOwner()
8888
{

src/Illuminate/Cache/DatabaseLock.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class DatabaseLock extends Lock
4444
* @param int $seconds
4545
* @param string|null $owner
4646
* @param array $lottery
47+
* @param int $defaultTimeoutInSeconds
4748
*/
4849
public function __construct(Connection $connection, $table, $name, $seconds, $owner = null, $lottery = [2, 100], $defaultTimeoutInSeconds = 86400)
4950
{

src/Illuminate/Cache/DatabaseStore.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class DatabaseStore implements LockProvider, Store
7676
* @param string $prefix
7777
* @param string $lockTable
7878
* @param array $lockLottery
79+
* @param int $defaultLockTimeoutInSeconds
7980
*/
8081
public function __construct(
8182
ConnectionInterface $connection,
@@ -169,6 +170,7 @@ public function put($key, $value, $seconds)
169170
/**
170171
* Store multiple items in the cache for a given number of seconds.
171172
*
173+
* @param array $values
172174
* @param int $seconds
173175
* @return bool
174176
*/

src/Illuminate/Cache/Events/CacheFlushFailed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CacheFlushFailed
2222
* Create a new event instance.
2323
*
2424
* @param string|null $storeName
25-
* @return void
25+
* @param array $tags
2626
*/
2727
public function __construct($storeName, array $tags = [])
2828
{

src/Illuminate/Cache/Events/CacheFlushed.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class CacheFlushed
2222
* Create a new event instance.
2323
*
2424
* @param string|null $storeName
25+
* @param array $tags
2526
*/
2627
public function __construct($storeName, array $tags = [])
2728
{

src/Illuminate/Cache/Events/CacheFlushing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CacheFlushing
2222
* Create a new event instance.
2323
*
2424
* @param string|null $storeName
25-
* @return void
25+
* @param array $tags
2626
*/
2727
public function __construct($storeName, array $tags = [])
2828
{

src/Illuminate/Cache/MemoizedStore.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public function put($key, $value, $seconds)
108108
/**
109109
* Store multiple items in the cache for a given number of seconds.
110110
*
111+
* @param array $values
111112
* @param int $seconds
112113
* @return bool
113114
*/

src/Illuminate/Cache/RedisTagSet.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public function flushStaleEntries()
9090
* Flush the tag from the cache.
9191
*
9292
* @param string $name
93+
* @return string
9394
*/
9495
public function flushTag($name)
9596
{

src/Illuminate/Database/Console/PruneCommand.php

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
use Illuminate\Console\Command;
66
use Illuminate\Contracts\Events\Dispatcher;
7-
use Illuminate\Database\Eloquent\MassPrunable;
8-
use Illuminate\Database\Eloquent\Prunable;
9-
use Illuminate\Database\Eloquent\SoftDeletes;
7+
use Illuminate\Database\Eloquent\Model;
108
use Illuminate\Database\Events\ModelPruningFinished;
119
use Illuminate\Database\Events\ModelPruningStarting;
1210
use Illuminate\Database\Events\ModelsPruned;
@@ -101,7 +99,7 @@ protected function pruneModel(string $model)
10199
? $instance->prunableChunkSize
102100
: $this->option('chunk');
103101

104-
$total = $this->isPrunable($model)
102+
$total = $model::isPrunable()
105103
? $instance->pruneAll($chunkSize)
106104
: 0;
107105

@@ -140,7 +138,6 @@ protected function models()
140138
);
141139
})
142140
->when(! empty($except), fn ($models) => $models->reject(fn ($model) => in_array($model, $except)))
143-
->filter(fn ($model) => class_exists($model))
144141
->filter(fn ($model) => $this->isPrunable($model))
145142
->values();
146143
}
@@ -161,31 +158,18 @@ protected function getPath()
161158
return app_path('Models');
162159
}
163160

164-
/**
165-
* Determine if the given model class is prunable.
166-
*
167-
* @param string $model
168-
* @return bool
169-
*/
170-
protected function isPrunable($model)
171-
{
172-
$uses = class_uses_recursive($model);
173-
174-
return in_array(Prunable::class, $uses) || in_array(MassPrunable::class, $uses);
175-
}
176-
177161
/**
178162
* Display how many models will be pruned.
179163
*
180-
* @param string $model
164+
* @param class-string $model
181165
* @return void
182166
*/
183167
protected function pretendToPrune($model)
184168
{
185169
$instance = new $model;
186170

187171
$count = $instance->prunable()
188-
->when(in_array(SoftDeletes::class, class_uses_recursive(get_class($instance))), function ($query) {
172+
->when($model::isSoftDeletable(), function ($query) {
189173
$query->withTrashed();
190174
})->count();
191175

@@ -195,4 +179,18 @@ protected function pretendToPrune($model)
195179
$this->components->info("{$count} [{$model}] records will be pruned.");
196180
}
197181
}
182+
183+
/**
184+
* Determine if the given model is prunable.
185+
*
186+
* @param string $model
187+
* @return bool
188+
*/
189+
private function isPrunable(string $model)
190+
{
191+
return class_exists($model)
192+
&& is_a($model, Model::class, true)
193+
&& ! (new \ReflectionClass($model))->isAbstract()
194+
&& $model::isPrunable();
195+
}
198196
}

0 commit comments

Comments
 (0)