Skip to content

v4.15.6

Latest

Choose a tag to compare

@github-actions github-actions released this 21 Aug 09:50
· 1 commit to master since this release
5949e9b

Two new inference sources for Eloquent-backed code, one new opt-in queue-safety rule, and three false-positive fixes across migrations, model attribute helpers, and pipelines.

Features

  • Add opt-in SerializedQueuedModel rule for ShouldQueue classes that hold an Eloquent model without reaching Illuminate\Queue\SerializesModels, where the whole model is written into the queue payload instead of a ModelIdentifier (#1385). Enable with <findSerializedQueuedModels value="true" />. Detection resolves the flattened __serialize() / __sleep() rather than matching the trait name, so framework bases that already pull the trait in (Illuminate\Foundation\Queue\Queueable, Illuminate\Notifications\Notification) and classes that hand-write their own serialization stay silent.
 final class ReconcileLedger implements ShouldQueue
 {
     public function __construct(private Customer $customer) {}
-    // silent: the entire Customer row is written into the queue payload
+    // SerializedQueuedModel: $customer will be serialized whole into the queue payload
 }
  • Infer Arr::pluck() value and key types from the element model's @property annotations, matching what Collection::pluck() and Builder::pluck() already do (#1383).
 /** @param list<Customer> $rows */   // Customer has @property string $id
-Arr::pluck($rows, 'id');        // array<array-key, mixed>
+Arr::pluck($rows, 'id');        // list<string>

Fixes

  • Support $schema = Schema::connection(...) in migrations, so columns declared through a variable-held builder (#1382).
  • Narrow Model::getAppends() and Model::getMutatedAttributes() to list<string>, so callers no longer have to re-assert the element type (#1381).
  • Type Pipeline::then() from its destination closure instead of leaving it mixed (#1376).

Full Changelog: v4.15.5...v4.15.6