Skip to content

Sync Laravel updates: #58337 → #58564 - #578

Merged
binaryfire merged 41 commits into
0.4from
laravel-parity-58337
Sep 11, 2026
Merged

Sync Laravel updates: #58337 → #58564#578
binaryfire merged 41 commits into
0.4from
laravel-parity-58337

Conversation

@binaryfire

Copy link
Copy Markdown
Member

Laravel updates

  • #58337, #61250, #61337 — Complete the vector cast and MariaDB similarity queries. Add AsVector, move distance SQL into the database grammars, and port the current cast and query tests. Preserve PostgreSQL bindings and Hypervel's embedding hook. Document both databases, with extension setup limited to PostgreSQL.
  • #60852 — Use direct Stringable construction in the remaining framework internals. Preserve the public helpers, nullable application URLs, terminal-width handling, generated class names and console cancellation behavior.
  • #58344, #60340 — Complete the Tailwind health-page update and escape its CSS @theme rule so an application's Blade directive cannot consume it. Verify the result through the real health route.
  • #58358, #58408, #58409, #59692, #60147, #60263, #60322, #60324, #60617, #60625, #60736, #60768 — Complete Number formatting history and coverage for fractions, rounding across unit boundaries, negative file sizes, nonfinite values and pair steps. Preserve callback result types and accurate formatting failure types, while retaining coroutine-local locale and currency overrides.
  • #61457 — Constrain model identifier collection-class annotations to Eloquent collections, without changing native signatures or serialized property order.
  • #60073 — Add the failed-job connection/queue/time index to generated, Testbench and fixture migrations. Use string connection and queue columns and restore the complete generator regression. Preserve the migration-layout checks used by applications with older bundled migration filenames.
  • #58357 — Remove unused host port publications from container-based database, Redis, Reverb and search-service CI jobs. Clients continue to use service DNS names and internal ports; service health checks and test commands are unchanged.
  • #58386 — Complete HTTP retry callback annotations. Keep the public and protected method signatures and correct the documented delay callback type.
  • #58367, #59174, #59268 — Restore the missing fractional translation conditions and pluralization assertions. Preserve Hypervel's stronger fractional cases and existing numeric conversion behavior.
  • #58361, #58373 — Document conditional CORS bypass and explain why Hypervel's deferred queue lifecycle can drain deferred callbacks. Deferred jobs use coroutine-exit callbacks, so Laravel's exclusion would suppress valid callbacks here.
  • #58390, #58440, #58405 — Exercise compiled-view cleanup through process setup, test-case setup and teardown, checking that sibling files survive. Port the remaining collection merge union type assertions.
  • #55941, #58399, #58413, #58414 — Document the existing queue startup, stopping, pop and exception-release events, including their queue selection and backoff data.
  • #58379 — Complete HTTP response JSON flag types and the upstream type fixture. Document per-call flags, boot-time defaults and custom decoder precedence while retaining flag-aware and falsy-result caching.
  • #58400 — Complete origin, token and exclusion coverage for request-forgery middleware. Correct the global-exclusion test so a local exclusion cannot conceal a broken global registration. Document the existing replacement for Laravel's deprecated CSRF middleware aliases.
  • #58436, #58469, #58753 — Complete the expression-selection feature and its later partial revert. Keep explicit selectExpression aliases, accept its string input, and stop inferring aliases from array keys for raw expressions. Document explicit expression selection and policy-query composition.
  • #58452, #55507, #58443 — Restore repeated notification-send and channel-reported failure coverage. Preserve Hypervel's per-invocation sender and provider-owned listener. Document fluent resource collection key preservation.
  • #59783 — Complete enum notification channel resolution tests and documentation. Preserve the shared manager's existing normalization instead of adding a redundant driver override.
  • #58457, #60646 — Preserve the requested encoding through the final Str::mask slice and port both Latin-1 regressions. Retain Hypervel's existing public string-helper contracts.
  • #58477, #58482, #58939, #59568 — Complete queued model serialization behavior and coverage. Honor WithoutRelations on parent job classes, preserve morph-map opt-in, and support integer aliases in serialized identifiers. Document relationship restoration and stable alias configuration across producers and workers.
  • #58507, #59948 — Release database locks with one key-and-owner DELETE. An expired original owner can remove its row, another owner's row remains protected, and concurrency-error handling is preserved. Remove the preliminary ownership SELECT.
  • #58529, #44370, #53625, #55631 — Preserve supplied enum defaults in inferred request input types and complete the current Request type fixture. Retain nullable route results and regenerate the Request facade from the source annotations.
  • #58505, #58506 — Document and test multiple MySQL/MariaDB index hints, keeping SQLite's single-index behavior separate. Restore the associative eager-load key regression and document keyed collections returned through afterQuery.
  • #58402, Laravel docs #10996 — Verify unique listener release using a real held lock. Check that the listener can reacquire the key and that later cleanup leaves its replacement lock intact. Clarify listener-wide versus per-item uniqueness and complete the example imports.
  • #58451, #61056, #58573 — Complete typed cache getter rejection and enum-key coverage, correct the default tests to exercise cache misses, and document typed retrieval and closure defaults. Align the schema starting-value description with upstream.

Additional Hypervel fixes

  • Quote column aliases as single identifiers, including dots and reserved words. Resolve expression-backed default vector aliases and avoid expanding dotted aggregate aliases into duplicate parent aggregates. Aggregate parsing no longer calls a custom builder's eager-load-only parseWithRelations override; eager loading and the shared normalization method retain their existing behavior.
  • Disable object caching for AsVector, so assigning an Arrayable value reads back as the promised float array. Compare cast values at stored float32 precision so assigning or recomputing an unchanged embedding avoids unnecessary updates. Document nullable vector values and correct the general null-casting guidance. Reject unsupported vector grammars before invoking embedding generation.
  • Preserve model columns when withCan adds an expression-based authorization result. Use explicit aliases without discarding caller selections; bound policy subqueries retain their existing path.
  • Keep small Number fractions at their original scale and omit a minus sign when rounding produces zero. Format exact and rounded zero at the same precision and locale, including decimal-comma output and non-Latin digits.
  • Store queue payloads as raw text so malformed jobs can be retained for investigation and valid payloads remain byte-for-byte intact. Use string failed-job identifiers because the provider accepts identifiers that are not UUIDs. Verify both generated migrations through real queue and failed-provider operations.
  • Preserve non-error responses in asynchronous HTTP retries. Redirect responses have no request exception and must not be retried or replaced with null. Reuse the existing exception for retry decisions, delays and the final result, preserving cancellation behavior.
  • Forward an explicit handler when dispatchAfterResponse is configured to run inline. The dispatcher previously discarded it and could invoke the command's own handler instead.
  • Let the existing CSRF token validator reject malformed array or numeric input. The token getter previously threw a TypeError before the normal token-mismatch response could be produced.
  • Use consistent character positions, lengths and encodings in afterLast, beforeLast and unwrap. Check suffix character boundaries before trimming, so a backslash byte inside an SJIS character is not mistaken for a standalone suffix. Preserve multiple-candidate handling and the existing byte-search APIs.
  • Keep concrete and inherited attribute lookups separate in the existing metadata cache. Parent job attributes can be honored without changing concrete-only callers or constructing attribute instances.
  • Correct tests that passed without exercising their claimed behavior: cache defaults, unique-listener release, compiled-view teardown and global CSRF exclusions. Extend existing cases and fixtures where possible rather than adding parallel test machinery.

Summary by cubic

Syncs Hypervel with upstream Laravel changes through #58564, completing port coverage and fixing regressions across storage, queue, HTTP client, and string behavior. This adds vector search support, changes queue payload storage, and alters database lock release semantics.

Key changes:

  • Adds AsVector cast and vector distance queries for PostgreSQL and MariaDB via grammar helpers. Cast comparisons use stored float32 precision, so recomputed embeddings that round to stored values no longer mark models dirty.
  • Stores queue payloads as raw text and uses string identifiers so malformed jobs survive and non-UUID IDs work; failed-jobs migrations gain a connection/queue/failed_at index.
  • Database lock release now uses a single key-and-owner DELETE, letting an expired owner remove its row while preserving another owner's row.
  • HTTP async retries preserve non-error responses instead of returning null, and dispatchAfterResponse forwards explicit handlers when running inline.
  • Queued model serialization honors WithoutRelations on parent classes and supports integer morph aliases.
  • Str::afterLast, beforeLast, and unwrap now respect the internal encoding to avoid splitting multibyte characters.
  • Notification channels can be resolved by backed enums. Formatted zero uses the requested locale's digits so locales with non-Latin numerals render consistently; the number tests now request the numbering system explicitly so they pass on both ICU versions.

Written for commit 0598d24. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added Eloquent vector casting and vector-distance queries for PostgreSQL and MariaDB 11.7+.
    • Added support for integer morph-map aliases and inherited relation-exclusion attributes.
    • Added configurable JSON decoding flags and custom decoders for HTTP responses.
    • Added typed cache retrieval methods with validation and defaults.
  • Bug Fixes

    • Preserved explicit handlers when dispatching synchronously after responses.
    • Improved database lock release behavior and multibyte string handling.
    • Corrected CSRF token validation for malformed values and same-site requests.
  • Documentation

    • Expanded guidance for vectors, caching, queues, CSRF protection, CORS, relationships, and HTTP responses.

Port the current AsVector caster and grammar-owned vector distance support
for PostgreSQL and MariaDB. Preserve stateless caster reuse across long-lived
workers, native Expression handling, existing vector bindings, and the
current Stringable embedding hook.

Fix inherited alias defects by quoting column aliases as single identifiers
and resolving expression-backed default vector aliases. Aggregate queries
normalize relation constraints without eager-loading parent expansion, so a
dotted alias produces exactly one aggregate. The owner approved the narrow
change for custom builders overriding only parseWithRelations; eager loading
and the underlying normalization extension point remain unchanged.

Disable object caching for the vector caster so assigned Arrayable values
read back as float arrays. Reject unsupported vector grammars before any
embedding generation. Port all applicable current upstream tests, add
focused regressions for these defects, and adapt the Laravel documentation
for AsVector and MariaDB, including PostgreSQL-only extension setup.

Upstream framework source: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2
Upstream documentation: 89e91b5cff48e1b9b1a7921300653eb1ceb7bfcb
laravel/framework#58337
laravel/framework#61250
laravel/framework#61337
Query Builder substitutions from laravel/framework#60852
(the remaining files of that PR are tracked separately).

Validation: changed test files, database unit suite through ParaTest, real
MariaDB 11.8 vector integration, formatting, full source and type-fixture
PHPStan. The unsupported-string regression fails before the guard and
passes afterward; complete SQL assertions cover alias and aggregate fixes.
Complete Laravel framework PR #60852 using source revision 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. Replace the remaining internal helper calls with direct construction and use the negative punctuation predicate. The public string helpers and their behavior remain unchanged.

Preserve nullable application URLs, narrow terminal widths, generated view class casing, console cancellation handling and native Stringable interfaces. Query Builder substitutions were completed with the vector port; JSON:API and view compiler behavior already match, and Laravel Cloud integration remains unsupported.

Validated the affected console, generator, mail and support suites with ParaTest, full source and type-fixture PHPStan, formatting, and generated facade consistency.

Upstream: laravel/framework#60852
Complete the Tailwind health-view update from Laravel framework PR #58344 with the literal directive escape from PR #60340, using source revision 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. Tailwind v4 was already present, but an application-defined theme directive could consume the CSS rule during Blade compilation.

Use the normal Blade escape so the browser receives the literal CSS at-rule. Add a real health-route regression with compiled-view caching disabled for that test, preventing an older artifact from hiding the collision. The regression fails on the original template and passes with the escape; all existing health responses remain covered.

Validated the health test file, affected ParaTest suites, full PHPStan source and type checks, and formatting.

Upstream: laravel/framework#58344
Upstream fix: laravel/framework#60340
Keep small fractions at their original scale and omit the minus sign when
rounding a negative magnitude to zero. Compare against zero at the same
precision and locale so formatted zeros such as 0.00 and 0,00 agree.

Preserve callback return types through withLocale and withCurrency while
retaining Hypervel's coroutine-local overrides and exact finally cleanup.
Correct formatting failure return types and document the list-of-tuples
result from pairs. Preserve explicit integer exponent normalization.

Complete the upstream regression cases for decimal formatting, rounding
across unit boundaries, negative file sizes, nonfinite values, and pair
steps. Keep the existing Hypervel tests and consistently type the touched
test class. No new state, parser, cache, or public API is introduced.

Ported from Laravel framework 13.x at
01d008c9b5f32cb7c5e50a9a22273113d810b2a2:
laravel/framework#58358
laravel/framework#58408
laravel/framework#58409
laravel/framework#59692
laravel/framework#60147
laravel/framework#60263
laravel/framework#60322
laravel/framework#60324
laravel/framework#60617
laravel/framework#60625
laravel/framework#60736
laravel/framework#60768

Validated the decimal regressions before and after the source corrections,
both Number test classes through ParaTest, formatting, full PHPStan and
type fixtures. Final review corrections passed the affected test class
and targeted formatting check.
Describe useCollectionClass's nullable argument as an Eloquent collection
class, matching the stored property and the serialization/restoration
path. Import Collection for both annotations without changing the native
signature, serialized property order, or morph-map behavior.

Completes the remaining applicable change from the separately inspected
post-cutoff Laravel typing PR. Its other four changes are already covered
by Hypervel's native signatures and current annotations.

laravel/framework#61457
Upstream merge: baedec2039f6fcbbb6578532c12f9aaebc5a6151

Validated with full PHPStan including the committed type fixtures, the
repository formatter, and review of the queue serialization callers.
Port Laravel #60073's string connection/queue columns and compound
connection/queue/failed_at index into the generator, Testbench schema and
both local migration fixtures. The index's useful leftmost prefix serves
connection-scoped counts; this does not add an index dedicated to pruning
or queue-only lookups. Keep Laravel's bundled migration checks for apps
that retain their original migration layout and explain their purpose.

Correct the generated jobs and failed_jobs schemas to retain raw payloads
as text. JSON storage rejects malformed jobs that must remain available for
failure investigation and normalizes ordinary payloads. Failed-job storage
uses string identifiers because the provider accepts non-UUID identifiers;
native PostgreSQL UUID columns rejected supported input. The schema fix
adds no runtime encoding, validation, compatibility branches or state.

Port the complete upstream generator test and exercise both real generated
migrations through database queue push/pop and failed-provider storage.
Two payload cases cover malformed JSON, generated IDs, supplied string IDs
and exact payload preservation. Proved each strict-column failure before
its correction on PostgreSQL; final coverage passes on SQLite, PostgreSQL,
MySQL and MariaDB. Affected tests, Testbench package-mode tests, formatting
and full source/type analysis pass.

Upstream: laravel/framework#60073
Source: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2
Adapt Laravel #58357's service-port correction to Hypervel's container jobs.
The database, Redis, Valkey, Reverb, Meilisearch and Typesense clients run
inside their job containers and reach services by DNS name and internal
port. Publishing those ports on the host serves no consumer.

Remove eleven publication blocks across four workflows. Keep service
images, health checks, internal port settings, matrices and test commands
unchanged. Redis Cluster nodes and Reverb test servers run inside the job
container and retain their existing loopback configuration. No dynamic
host-port plumbing is required and no Hypervel port collision is claimed.

Parsed all four YAML files and compared their structures with the base:
only the eleven service publication fields differ, and every affected job
declares a container. Live GitHub orchestration runs at the PR checkpoint.

Upstream: laravel/framework#58357
Source: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2
Complete the PendingRequest callback annotations from Laravel PR #58386 and correct an adjacent upstream retry defect. Async requests previously retried redirect responses without an exception and returned null when retry throwing was enabled. Require an exception before retrying and preserve the response when there is none.

Compute the request exception once inside the existing failure handler and reuse it for the retry policy, delay and final return. Preserve cancellation handling, request-method capture, public APIs and protected helper signatures. Correct the documented delay callback type and missing ConnectionException import.

Add synchronous and asynchronous regression cases with both retry throw settings. Both async cases fail before the correction. HTTP package tests, source and type-fixture analysis, formatting and generated-facade validation pass.

Upstream: laravel/framework#58386
Porting source: laravel/framework 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.
Merge the missing decimal condition fallback and fractional pluralization assertions from the current Laravel translation tests. Keep the stronger Hypervel assertions that exercise fractional modulo conversion and distinguish non-integral plural forms; the upstream additions supplement them.

The existing numeric condition parser and local modulo casts already provide the intended source behavior. Add the provider title required by local conventions without changing translation runtime behavior. The edited test file, translation package tests, formatting and full static analysis pass.

Upstream: laravel/framework#58367
laravel/framework#59174
laravel/framework#59268
Porting source: laravel/framework 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.
Complete the user-facing documentation for the existing HandleCors::skipWhen API from Laravel PR #58361. Show registration in AppServiceProvider::boot, explain that a matching callback also bypasses the dynamic configuration resolver, and note that callbacks run before path matching.

Place the section before dynamic configuration and link it from the contents and resolver discussion. The pinned upstream documentation has no equivalent usage example. Existing HTTP middleware tests pass; no runtime change or duplicate tests are needed.

Upstream: laravel/framework#58361
Framework source: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.
Documentation reference: 89e91b5cff48e1b9b1a7921300653eb1ceb7bfcb.
Record why deferred queue attempts may drain DeferredCallbackCollection. DeferredQueue schedules jobs through native coroutine-exit callbacks, so this collection does not contain the job being completed and cannot recursively run it.

Laravel PR #58373 excludes deferred queue events because its scheduling uses the same collection. Copying that exclusion would suppress valid Hypervel callback execution. Preserve the existing behavior and document its owning boundary. DeferredCallbacksTest passes, including deferred and background connections; formatting and full static analysis pass.

Upstream: laravel/framework#58373
Compared with laravel/framework 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.
Extend the existing teardown regression from Laravel PRs #58390 and #58440 beyond callback registration. Run process setup, test-case setup and process teardown, then verify that the nonempty process directory is removed while the shared root and sibling file survive.

Use the standard process-isolated temporary directory and real filesystem binding. Retain facade application cleanup and rely on the central subscriber for duplicate framework-static resets. Preserve Hypervel’s stateless, idempotent compiled-view path handling.

Validation: focused TestViews tests, related parallel-testing suites, formatting, and full source/type analysis pass.

Upstream: laravel/framework#58390
laravel/framework#58440
Source reference: laravel/framework 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.
Port all four mixed-value merge assertions from Laravel PR #58405 into the existing combined eager and lazy collection fixture. Preserve integer/string literals and verify both merge directions.

Collection and Enumerable already expose the correct TMergeValue union, so no runtime or contract changes are needed. Validation: the focused type fixture and full source/type analysis pass; formatting is clean.

Upstream: laravel/framework#58405
Source reference: laravel/framework 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.
Complete the public documentation accompanying Laravel PRs #55941, #58399, #58413 and #58414. Describe startup and stopping registration from provider boot, the configured queue selection before a pop, the retrieved job after a successful pop, and exception-release metadata including backoff seconds.

Runtime implementations and upstream assertions are already present. Keep the documentation concise and pair related hooks without duplicating listener examples. Verify every described field and dispatch condition against current source; no queue behavior or APIs change.

Upstream: laravel/framework#55941
laravel/framework#58399
laravel/framework#58413
laravel/framework#58414
Source reference: laravel/framework 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2; docs at 89e91b5cff48e1b9b1a7921300653eb1ceb7bfcb.
Port the remaining int-mask annotations and the original Response type
fixture from Laravel framework PR #58379. Carry the same accepted flag set
through Hypervel's existing decode helper so the public and internal
boundaries agree without changing native signatures or runtime behavior.

Preserve custom decoder precedence, flag-aware caching, falsy payload
caching and centralized static cleanup. The upstream runtime assertions
are already present; add only the missing upstream PHPStan fixture.

Upstream: laravel/framework#58379
Source: laravel/framework 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2

Validation: complete source and type analysis, affected HTTP/Bus/response
consumer tests, formatting and independent code review pass.
Complete the public documentation for Laravel framework PR #58379's JSON
decoding flags. Show the flags arguments on object, collect and fluent,
and explain per-call overrides and configuring the shared default during
worker startup.

Describe custom decoder precedence because decodeUsing replaces JSON
decoding and makes flags inapplicable. Correct the object return type in
the method list to cover scalar JSON and custom decoder results.

Upstream: laravel/framework#58379
Compared with laravel/docs at 89e91b5cff48e1b9b1a7921300653eb1ceb7bfcb;
its current page does not explain these defaults or custom decoding.

Validation: checked examples and prose against response methods and
existing decoding regressions; independent review completed.
Forward the supplied handler to dispatchSync when dispatchAfterResponse
runs inline. Previously withoutDispatchingAfterResponses caused that
argument to be discarded, invoking the command's own handler or failing
for commands that rely exclusively on the explicit handler.

Found while reconciling Laravel framework PR #58428. The contract and fake
already include and forward the handler; the concrete dispatcher has the
same omission in pinned upstream. Correct it at that single boundary,
without changing deferred execution, queue handling or worker state.

Add one regression using the existing immediate-command fixture. Verify
that the explicit handler receives the identical command and that the
command's own handle method does not run. The test fails before the fix
and passes after it.

Related upstream: laravel/framework#58428
Compared against laravel/framework 13.x at
01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: BusDispatcherTest, affected HTTP/Bus/response consumer tests,
complete source/type analysis, formatting and independent review pass.
Complete the direct middleware coverage from Laravel framework PR #58400,
using the current 13.x tests at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Hypervel's nullable-string token getter threw TypeError for array or numeric
request input before tokensMatch could reject it. Return the raw value as
mixed so the existing string predicate owns validation and the normal token
mismatch response is preserved. No coercion or duplicate guard is added.

Port all nine origin/token cases and add one regression for an array token.
Use Hypervel's test base, session API, native types and centralized cleanup.
Record the existing omission of deprecated CSRF middleware aliases and apply
the imported exception and strict comparison conventions in the touched code.

The regression fails with the former getter signature. Affected middleware,
configuration, broadcasting and Sanctum tests pass, as do full formatting and
both PHPStan checks. Peer review also verified reverse-order static cleanup.

laravel/framework#58400
Port the five exclusion tests and fixture from the current Laravel 13.x
implementation of PR #58400 at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.
Preserve path, URL, slash and wildcard assertions, using native types and
Hypervel Testbench. Keep these service-free tests under tests/Http.

Correct the upstream global-exclusion test: installing the same path as a
local exclusion made its assertion pass without global registration. Supply
an empty local list so the assertion depends on the global exclusion itself.
Framework test cleanup owns resetting that static configuration.

The test file and the affected middleware, configuration, broadcasting and
Sanctum suite pass. Formatting and full source/type analysis also pass.

laravel/framework#58400
Complete the existing omission record for Laravel's deprecated
VerifyCsrfToken and ValidateCsrfToken aliases introduced by PR #58400.
Hypervel already omits those classes and the validateCsrfTokens method.

Direct application and package ports to PreventRequestForgery and the
preventRequestForgery configuration method. Mention the native array type
needed when overriding the exclusions property, and link to the canonical
CSRF documentation instead of duplicating its feature examples.

Checked the replacement names and property type against current source,
and the guide anchor and link against the existing documentation.

laravel/framework#58400
Complete Laravel framework PRs #58436, #58469 and #58753 against source revision 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. Remove automatic aliases inferred from array keys, which can wrap already-aliased raw SQL into an invalid expression. Preserve the explicit selectExpression API and accept its current string form.

Keep Hypervel single-identifier alias quoting and source-aware default columns. Adapt withCan to explicitly alias expression results while preserving model columns and caller selections; bound policy subqueries keep their existing path. Preserve source-alias regression assertions using supported keyed subqueries, and cover raw SQL preservation, model hydration, explicit selections and bindings.

Verified the affected query and grammar tests, Auth suite and SQLite database integration suite, full source and type-fixture analysis, and formatting. No extra database queries or shared state are introduced.

Upstream: laravel/framework#58436
Upstream partial revert: laravel/framework#58469
Upstream string support: laravel/framework#58753
Document selectExpression beside selectRaw, including string and expression inputs, single-identifier alias quoting, and when to use bindings instead. This completes the public documentation for Laravel framework PRs #58436 and #58753 while following the selection behavior restored by #58469.

Explain how callers composing Gate selections use selectExpression for raw expressions and keyed addSelect for query builders. Name the model-column requirement and point callers to withCan when they want that composition handled for them.

Checked the examples and descriptions against the query builder and Gate contracts; the accompanying runtime correction passed Auth and SQLite integration suites, static analysis and formatting.

Upstream: laravel/framework#58436
Upstream: laravel/framework#58469
Upstream: laravel/framework#58753
Port the repeated-send regression from Laravel #58452 and the channel-reported failure case from #55507 against the current 13.x source at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Exercise the real provider listener for channel-owned failures and verify that a reported failure without an exception leaves no attempt state behind. Preserve the existing nested, sequential and coroutine-isolation regressions, moving their service-free test class into tests/Notifications.

Retain Hypervel’s per-invocation sender and provider-owned listener instead of caching Laravel’s sender. The existing implementation avoids accumulating listeners, freezing a previous locale, or suppressing a later failure after a channel returns normally.

Validation: affected test files, the Notifications ParaTest suite, formatting and full source/type analysis pass.

Upstream: laravel/framework#58452
laravel/framework#55507
Complete Laravel #58457 and #60646 from 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. Pass the requested encoding to the final mask slice, including both upstream Latin-1 assertions.

Use the same internal encoding for afterLast, beforeLast and unwrap positions, lengths and slices. The previous mixed byte/character and internal/UTF-8 operations could split or corrupt correctly encoded SJIS input. Keep cheap suffix checks in chopEnd and unwrap, then verify character alignment before removing a character-counted suffix; a rejected chopEnd candidate continues to the next needle.

Add one encoding-scoped regression covering extraction, wrapping, a backslash byte inside an SJIS character, real trailing backslashes and multiple suffix candidates. Restore process encoding in finally without yielding. Keep substrReplace and the byte-search APIs unchanged; this does not impose a new class-wide encoding policy. As with current Laravel, afterLast now follows mbstring substitution for invalid input bytes.

Validation: SupportStrTest, the Support ParaTest suite, formatting and full source/type analysis pass.

Upstream: laravel/framework#58457
laravel/framework#60646
Complete the user documentation for Laravel #58443 by showing preserveKeys on the anonymous collection returned by UserResource::collection. The method and its upstream runtime regression were already present; this example makes the per-collection option discoverable beside the existing class-level guidance.

Checked the example against AnonymousResourceCollection and the pinned Laravel 13.x source at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. No source behavior or new test machinery is needed.

Upstream: laravel/framework#58443
Honor the morph-map setting when restoring model identifiers so a class-name map key cannot redirect an ordinary queued model while alias serialization is disabled.

Store integer morph aliases as integers, matching Laravel payloads and allowing Hypervel workers to deserialize them. Keep the nullable-string getter contract through explicit scalar normalization under strict typing. Preserve public property order and constructor class-name input.

Extend the owning tests for opt-in gating, exact integer payloads, restoration, unmapped alias conversion and null classes. Rely on the existing global test subscriber for static cleanup.

Upstream: laravel/framework#58939
Related feature: laravel/framework#58482
Source: laravel/framework 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: owning serialization tests, Queue/Log/Scout suites, full source and type-fixture analysis, formatting and diff checks pass. Regression assertions fail against the previous implementation.
Recognize WithoutRelations on parent job classes while retaining cached metadata lookup for long-lived workers. Cache concrete and inherited presence separately; inspect parent classes without constructing attributes or inheriting trait attributes. Existing callers retain concrete-only lookup by default, and the existing reset clears both modes.

Correct the old inherited-attribute expectation and port the upstream parent-class integration case. Restore the original one-model morph-map collection regression, including its exact serialized bytes and identity assertions, while preserving the custom collection ordering test. Remove duplicate static teardown and complete the touched test files native typing and method titles.

Upstream:
laravel/framework#59568
laravel/framework#58939
Source: laravel/framework 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: all four owning test files and Queue/Log/Scout suites pass, along with full source/type analysis and formatting. The inherited fixture retains relations with the old trait and excludes them with this fix. Cache tests cover independent modes, negative caching, trait exclusion and reset behavior.
Correct the stale claim that queued Eloquent collections never restore relationships. Explain that shared loaded relations are restored, distinguish plain arrays that carry full model state, and describe WithoutRelations on parent job classes.

Document the existing morph-map serialization opt-in at its application-facing surface. Explain how stable aliases support model renames and require producers and workers to retain matching maps and settings while aliased jobs remain queued.

Upstream features:
laravel/framework#58477
laravel/framework#58482
laravel/framework#59568
Compared with laravel/docs at 89e91b5cff48e1b9b1a7921300653eb1ceb7bfcb, which still contains the stale collection paragraph and omits the other guidance.

Validation: documentation checked against collection relation intersection, model restoration and ordinary array serialization. Existing and ported integration tests pass; linked documentation anchor and diff checks verified.
Complete the release half of Laravel #59948. Ownership inspection already
excluded expired rows, but release still used that inspection as a preflight,
so an expired original owner could no longer remove its row. Rows remained
until reuse or pruning.

Use the current upstream key-and-owner DELETE and report its affected-row
result. This removes the preliminary SELECT, preserves another owner's row,
and retains the concurrency-error handling introduced by #58507. Resolve the
connection through Hypervel's existing resolver; coroutine connection
retention and pool ownership remain unchanged.

Adapt the release unit cases to the single query and consolidate identical
zero-row mocks. Preserve the original expiration inspection test, add real
expired-owner cleanup and repeat-release coverage, and verify wrong-owner
release cannot remove the active owner's row. Keep both upstream error cases
with the current single-query expectations.

Upstream:
laravel/framework#58507
laravel/framework#59948
Source: laravel/framework 01d008c9b5f32cb7c5e50a9a22273113d810b2a2

Validation: both edited test files and the Cache ParaTest suite pass; full
PHPStan source/type-fixture analysis and PHP-CS-Fixer pass. The expired-owner
regression was reproduced against the previous implementation.
Carry the default value through InteractsWithData::enum with its own generic so a supplied enum default no longer leaves null in the inferred result. Preserve the existing enum normalization and runtime behavior.

Port the complete current Request type fixture, including enum, route and JSON return assertions. Keep the accurate nullable route result when no resolver provides a route, and regenerate the Request facade from the formatted source annotations.

Upstream: laravel/framework#58529
Fixture history: laravel/framework#44370
laravel/framework#53625
laravel/framework#55631
Source pin: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: full source and type-fixture PHPStan analysis, formatting, focused request/data tests through ParaTest, and the complete facade-docblock checks passed.
Document comma-separated index names for MySQL and MariaDB beside the existing index-hint APIs. Keep SQLite guidance separate because its indexed-by clause accepts one index name.

Extend the existing query-builder test with a multiple-index assertion while retaining the single-index case. This protects the per-name validation already implemented by the grammar against returning to whole-string validation.

Upstream: laravel/framework#58505
Source pin: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. No runtime changes were needed.

Validation: the complete DatabaseQueryBuilderTest, formatting, full source/type analysis and diff checks passed.
The unique-until-processing listener test supplied a mock whose acquisition
always succeeded. It passed even when the listener ran before its unique
lock was released, so it did not protect the behavior its name described.

Use an ArrayStore lock held before processing and reacquire that key from
the existing listener fixture. Check that the replacement lock survives
cleanup, preserving the previous once-only release expectation through
observable behavior. Share the expected key between setup and assertions,
and remove the fixture's canned-success mock without adding another test.

This completes validation of Laravel's unique queued-listener port:
laravel/framework#58402
Compared against framework 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.
The production implementation and its ownership protections are unchanged.

Validation: QueuedEventsTest, formatting, and source/type analysis pass.
Deliberately late and repeated release each fail the corrected test at
their respective assertions.
The first unique-listener example has no uniqueId, so its lock covers all
instances of that listener rather than individual licenses. Describe that
scope explicitly; the following example already introduces per-license
uniqueness through uniqueId.

Add the missing ShouldQueue and ShouldBeUnique imports to the custom-cache
examples, and ShouldQueue to the six job-attribute examples that declare
the interface without importing it. Each affected snippet failed interface
resolution when evaluated with the real autoloader.

These correct omissions inherited from Laravel's current documentation:
laravel/framework#58402
laravel/docs#10996
Compared against docs 89e91b5cff48e1b9b1a7921300653eb1ceb7bfcb.

Validation: all eight corrected snippets compile in isolated PHP processes.
Formatting, source/type analysis and diff checks pass. No runtime behavior
or application API changes.
Port the missing belongs-to-many eager-loading regression and its keyed posts fixture from Laravel. The test verifies that related model IDs remain the collection keys after eager loading; the existing relation dictionaries already implement that behavior.

Document afterQuery and a slug-keyed related collection at the eager-loading surface. Match the explicit upstream array-key spelling on the through-relation dictionary without changing its equivalent type or runtime behavior. Add native test and fixture return types while preserving all existing callback and cursor cases.

Upstream: laravel/framework#58506
Source: laravel/framework at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: the complete AfterQueryTest passes on isolated in-memory SQLite. The new assertion fails when a scratch relation dictionary drops associative keys. Formatting and full source/type PHPStan checks pass.
Finish the test and documentation portions of Laravel #58451 and #61056 against framework revision 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. The repository methods and enum normalization were already implemented.

Correct all five missing-key default tests to return null from their store mocks. Previously each mock returned the expected default as a cache hit, so the assertions did not exercise fallback behavior. Preserve the scalar default case and add one closure-default assertion to the same string test.

Merge upstream scalar literals into the existing tests, add the missing non-numeric string rejection cases and complete enum mismatch provider, and retain the additional Hypervel cases. Document typed retrieval, defaults, errors and numeric-string handling at the existing cache retrieval surface.

Validation: CacheRepositoryTest, composer lint:fix, full source and type-fixture PHPStan, and diff checks pass. No runtime behavior, public API, coroutine state or hot-path work changes.

Upstream: laravel/framework#58451
Upstream: laravel/framework#61056
Port Laravel #58573 from framework revision 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. Remove the spaces around the database separator in the from() annotation, matching the adjacent startingValue() description and the current upstream text.

This changes documentation formatting only. Formatting, full source and type-fixture PHPStan, and diff checks pass; no runtime test is needed for the spacing change.

Upstream: laravel/framework#58573
Route exact zero through Number::format at every precision so locales with
non-Latin digits produce the same zero representation as rounded values.
This also lets the existing sign comparison suppress a minus sign when a
small negative number rounds to localized zero.

Keep the protected return refinement accurate for locale-dependent output.
Extend the existing human-readable and abbreviated formatting tests with
Arabic exact zero, rounded zero and maximum-precision cases.

This completes the formatting corrections around Laravel's number history:
laravel/framework#58358
laravel/framework#61457
Upstream reference: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: Number tests, affected parallel tests, formatting and full
source/type-fixture static analysis pass.
Implement the existing cast comparison contract so a hydrated MariaDB
vector and an equivalent assigned SQL expression are not always dirty.
Decode each representation and compare native float32 bytes, matching
MariaDB and PostgreSQL vector storage. Recomputed embeddings that round to
the stored values no longer cause unnecessary updates, while the next
representable float32 value still counts as a change.

Handle a null original before packing. Cover both database representations,
reassignment, recomputation, changed values, changed lengths and both null
transitions through the model's dirty-tracking API. The reverse null
transition remains handled by Eloquent's existing early exit.

Correct the casting documentation to distinguish primitive null handling
from custom cast classes, and explicitly describe nullable vector values.
No mutable caster state or new comparison mechanism is introduced.

Follow-up to the vector port:
laravel/framework#58337
laravel/framework#61250
laravel/framework#61337
Upstream reference: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: vector model tests, affected parallel tests, formatting and
full source/type-fixture static analysis pass. Existing MariaDB integration
coverage still exercises vector insertion, updates and distance queries.
Port both upstream string-backed enum cases for named channels and custom
channel classes. Hypervel already normalizes enum identifiers in the shared
manager, so no redundant driver override is needed. Retain the existing
integer-backed enum coverage and use the local typed container fixture.

Document enum identifiers specifically when resolving a channel instance
with Notification::channel. Point the repeated-send regression to the
separate real-provider test that proves channel-owned failure events are
not dispatched twice, preserving each test's distinct purpose.

Laravel PR: laravel/framework#59783
Original change: 95891fa4a7dc34648d7e78695173148ba9a41299.
Current upstream reference: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: channel-manager and failure-event tests pass, including the
affected parallel run. Formatting and full static analysis pass.
Clarify that a native PostgreSQL UUID column would reject the supplied
identifier accepted by the failed-job provider. The comment now explains
why the fixture protects the shipped migration's string column choice,
without suggesting that the generated table still uses a native UUID.

The test continues to generate the real queue migrations and verify exact
payload bytes and supplied identifiers through the queue and failed-job
provider. No schema or runtime behavior changes in this commit.

Related migration port: laravel/framework#60073
Validation: the generated-table regression passes using isolated in-memory
SQLite; formatting and whitespace checks pass.
The localized zero regressions assumed that the ar locale always selected Arabic-Indic digits. ICU 74.2 uses those digits by default, while ICU 76.1 in both PHP CI images selects Latin digits, causing correct formatter output to fail the assertions.

Request ar@numbers=arab explicitly in the existing forHumans and abbreviate cases and explain why the numbering system is specified. Preserve every assertion and the source behavior. The tests still reject the earlier ASCII-zero implementation on both ICU versions.

Validated the complete test file locally and in the PHP 8.4 and PHP 8.5 CI images, plus targeted formatting and whitespace checks. This corrects the regression coverage associated with the Number formatting port: laravel/framework#58358.
@binaryfire
binaryfire merged commit 0fb0564 into 0.4 Sep 11, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Sync Laravel parity through #58564 across framework subsystems

✨ Enhancement 🐞 Bug fix 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Adds vector casting and similarity queries for PostgreSQL and MariaDB.
• Fixes queue, HTTP, locking, serialization, number, and multibyte string regressions.
• Expands integration coverage, type fixtures, documentation, migrations, and CI configuration.
Diagram

graph TD
  A["Application APIs"] --> B["Eloquent Models"] --> C["Query Builder"] --> D["DB Grammars"] --> E["Postgres MariaDB"]
  A --> F["HTTP Queue"]
  A --> G["Support Utilities"]
  H["Regression Tests"] --> B
  H --> F
  H --> G
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Split parity sync by subsystem
  • ➕ Allows focused ownership and shorter review cycles
  • ➕ Simplifies rollback and regression isolation
  • ➕ Makes release notes and risk assessment clearer
  • ➖ Requires coordinating dependencies between query, grammar, cast, and documentation changes
  • ➖ Increases merge overhead and may temporarily leave parity work incomplete
2. Port only upstream changes
  • ➕ Reduces divergence from Laravel and lowers maintenance burden
  • ➕ Produces a smaller compatibility-focused diff
  • ➖ Would retain Hypervel-specific regressions in async retries, vectors, queues, and multibyte strings
  • ➖ Upstream tests do not fully exercise coroutine and database differences

Recommendation: For future parity batches, split changes into database, queue, HTTP, and support PRs while keeping tightly coupled implementation, tests, and documentation together. For this PR, the current combined approach is defensible because the additional Hypervel fixes close regressions exposed by the upstream ports; review should still be assigned by subsystem.

Files changed (94) +2448 / -419

Enhancement (8) +241 / -56
ModelIdentifier.phpSupport integer morph aliases in model identifiers +13/-12

Support integer morph aliases in model identifiers

• Preserves integer aliases during serialization, gates reverse mapping behind morph-map opt-in, and narrows collection annotations to Eloquent collections.

src/contracts/src/Database/ModelIdentifier.php

AsVector.phpAdd cross-database Eloquent vector cast +116/-0

Add cross-database Eloquent vector cast

• Adds nullable array and Arrayable vector casting for PostgreSQL and MariaDB. MariaDB binary values and expressions are decoded correctly, while dirty comparisons use stored float32 precision.

src/database/src/Eloquent/Casts/AsVector.php

Builder.phpDelegate vector SQL and require explicit expression aliases +37/-30

Delegate vector SQL and require explicit expression aliases

• Moves vector distance compilation into grammars, adds MariaDB support, and validates grammar support before embedding generation. Raw expressions no longer infer aliases from array keys; 'selectExpression' accepts strings and quotes aliases explicitly.

src/database/src/Query/Builder.php

Grammar.phpDefine vector grammar extension points +18/-0

Define vector grammar extension points

• Adds default vector-distance compilation and capability methods for database grammars.

src/database/src/Query/Grammars/Grammar.php

MariaDbGrammar.phpCompile MariaDB cosine vector distance +17/-0

Compile MariaDB cosine vector distance

• Implements vector capability detection and MariaDB 'vec_distance_cosine' SQL using 'vec_fromtext'.

src/database/src/Query/Grammars/MariaDbGrammar.php

PostgresGrammar.phpCompile PostgreSQL pgvector distance +17/-0

Compile PostgreSQL pgvector distance

• Implements vector capability detection and PostgreSQL cosine-distance SQL.

src/database/src/Query/Grammars/PostgresGrammar.php

failed_jobs.stubGenerate raw failed-job storage and lookup index +8/-4

Generate raw failed-job storage and lookup index

• Uses string identifiers, string connection and queue columns, long-text payloads, and a connection/queue/time index.

src/queue/src/Console/stubs/failed_jobs.stub

ClassMetadataCache.phpCache concrete and inherited attributes separately +15/-10

Cache concrete and inherited attributes separately

• Adds optional parent traversal while preserving concrete-only and trait-excluding lookups in distinct cache entries.

src/reflection/src/ClassMetadataCache.php

Bug fix (12) +106 / -63
AuthServiceProvider.phpPreserve columns for expression-based authorization selections +14/-3

Preserve columns for expression-based authorization selections

• Handles expression-backed 'withCan' results through explicit aliases while retaining existing model columns and caller selections.

src/auth/src/AuthServiceProvider.php

Dispatcher.phpForward inline after-response handlers +1/-1

Forward inline after-response handlers

• Passes an explicit handler to synchronous dispatch when after-response dispatching is disabled.

src/bus/src/Dispatcher.php

DatabaseLock.phpRelease database locks with one owned delete +9/-15

Release database locks with one owned delete

• Replaces the ownership lookup with an atomic key-and-owner delete and reports whether a matching row was removed.

src/cache/src/DatabaseLock.php

QueriesRelationships.phpCorrect aggregate alias normalization and quoting +3/-2

Correct aggregate alias normalization and quoting

• Avoids eager-load parent expansion for aggregate aliases and quotes aliases such as dotted names as single identifiers.

src/database/src/Eloquent/Concerns/QueriesRelationships.php

PreventRequestForgery.phpAllow normal rejection of malformed CSRF tokens +8/-5

Allow normal rejection of malformed CSRF tokens

• Returns raw token input so array and numeric values reach the existing string validator instead of causing a return-type error.

src/foundation/src/Http/Middleware/PreventRequestForgery.php

health-up.blade.phpEscape Tailwind theme directive in Blade +1/-1

Escape Tailwind theme directive in Blade

• Escapes '@theme' so application-defined Blade directives cannot consume the Tailwind rule.

src/foundation/src/resources/health-up.blade.php

PendingRequest.phpPreserve successful async retry responses +11/-8

Preserve successful async retry responses

• Avoids retrying or replacing responses without request exceptions and reuses the resolved exception for callbacks, delays, and final results.

src/http/src/Client/PendingRequest.php

jobs.stubStore generated queue payloads as raw text +2/-1

Store generated queue payloads as raw text

• Switches queued payload storage from validated JSON to long text, preserving malformed and byte-exact payloads.

src/queue/src/Console/stubs/jobs.stub

SerializesModels.phpHonor inherited WithoutRelations attributes +1/-1

Honor inherited WithoutRelations attributes

• Checks parent job classes when deciding whether serialized models should retain relationships.

src/queue/src/SerializesModels.php

Number.phpCorrect small, rounded, and localized number summaries +27/-9

Correct small, rounded, and localized number summaries

• Keeps small fractions at their original scale, removes negative zero signs, and formats zero through the locale-aware formatter. Return and callback annotations now reflect actual failure and generic result types.

src/support/src/Number.php

Str.phpRespect encodings in string boundaries and masking +21/-10

Respect encodings in string boundaries and masking

• Uses consistent character offsets and boundary checks for last-occurrence, unwrap, and suffix operations. The final 'mask' slice now preserves the requested encoding.

src/support/src/Str.php

InteractsWithData.phpPreserve enum defaults and construct strings directly +8/-7

Preserve enum defaults and construct strings directly

• Improves enum generic annotations so supplied defaults retain their inferred type and removes helper use from string retrieval.

src/support/src/Traits/InteractsWithData.php

Refactor (14) +41 / -23
QuestionHelper.phpUse direct Stringable punctuation predicate +1/-1

Use direct Stringable punctuation predicate

• Uses 'doesntEndWith' when determining whether console prompts need punctuation.

src/console/src/QuestionHelper.php

EnsurePunctuation.phpSimplify punctuation detection +1/-1

Simplify punctuation detection

• Uses the direct negative Stringable predicate without changing rendered punctuation.

src/console/src/View/Components/Mutators/EnsurePunctuation.php

HasOneOrManyThrough.phpBroaden relation dictionary key annotation +1/-1

Broaden relation dictionary key annotation

• Corrects the dictionary return type to include arbitrary related-model keys.

src/database/src/Eloquent/Relations/HasOneOrManyThrough.php

AboutCommand.phpConstruct application URL Stringable directly +1/-1

Construct application URL Stringable directly

• Removes helper usage while preserving nullable application URL handling.

src/foundation/src/Console/AboutCommand.php

DevListCommand.phpConstruct source labels directly +2/-1

Construct source labels directly

• Uses direct Stringable construction while preserving terminal-width truncation.

src/foundation/src/Console/DevListCommand.php

ModelMakeCommand.phpConstruct generated model paths directly +2/-1

Construct generated model paths directly

• Replaces the fluent string helper without changing generated factory class names.

src/foundation/src/Console/ModelMakeCommand.php

ViewMakeCommand.phpUse direct Stringable construction in view generation +7/-7

Use direct Stringable construction in view generation

• Replaces helper calls throughout test path, namespace, class-name, and view-name generation.

src/foundation/src/Console/ViewMakeCommand.php

Handler.phpConstruct console exception messages directly +2/-2

Construct console exception messages directly

• Uses Stringable directly when extracting command-not-found messages.

src/foundation/src/Exceptions/Handler.php

Response.phpComplete JSON decoding flag annotations +12/-0

Complete JSON decoding flag annotations

• Adds precise integer-mask types to JSON response decoding methods and state.

src/http/src/Client/Response.php

Headers.phpConstruct header references directly +2/-2

Construct header references directly

• Uses direct Stringable construction while retaining message-ID formatting.

src/mail/src/Mailables/Headers.php

LogTransport.phpConstruct logged mail content directly +5/-2

Construct logged mail content directly

• Uses direct Stringable construction and documents the transport send method.

src/mail/src/Transport/LogTransport.php

Request.phpAlign Request enum facade annotation +1/-1

Align Request enum facade annotation

• Regenerates the enum getter annotation from updated request type information.

src/support/src/Facades/Request.php

ServiceProvider.phpConstruct provider keys directly +3/-2

Construct provider keys directly

• Uses Stringable directly while preserving generated provider keys as native strings.

src/support/src/ServiceProvider.php

Uri.phpConstruct URI Stringable directly +1/-1

Construct URI Stringable directly

• Returns a directly constructed Stringable without changing the public URI conversion contract.

src/support/src/Uri.php

Tests (36) +1855 / -230
AuthEloquentBuilderCanTest.phpTest authorization selection preservation +18/-0

Test authorization selection preservation

• Verifies 'withCan' retains explicit columns and existing select bindings.

tests/Auth/AuthEloquentBuilderCanTest.php

BusDispatcherTest.phpTest explicit inline dispatch handlers +16/-0

Test explicit inline dispatch handlers

• Confirms disabled after-response dispatch invokes the supplied handler instead of the command handler.

tests/Bus/BusDispatcherTest.php

CacheDatabaseLockTest.phpTest single-delete lock release behavior +4/-21

Test single-delete lock release behavior

• Updates mocks to verify owner-constrained deletion and false results when no row matches.

tests/Cache/CacheDatabaseLockTest.php

CacheRepositoryTest.phpStrengthen typed cache getter coverage +88/-34

Strengthen typed cache getter coverage

• Ensures defaults exercise cache misses, validates closures and mismatches, and covers backed-enum cache keys.

tests/Cache/CacheRepositoryTest.php

ModelIdentifierTest.phpTest opt-in and integer morph-map behavior +66/-21

Test opt-in and integer morph-map behavior

• Covers raw class preservation, delayed map enablement, integer alias serialization, and nullable classes.

tests/Contracts/Database/ModelIdentifierTest.php

DatabaseEloquentAsVectorCastTest.phpTest Eloquent vector casting +216/-0

Test Eloquent vector casting

• Covers PostgreSQL text and MariaDB binary representations, nulls, Arrayable input, invalid values, pre-save reads, and float32 dirty tracking.

tests/Database/DatabaseEloquentAsVectorCastTest.php

DatabaseEloquentBuilderTest.phpTest literal aggregate aliases +24/-0

Test literal aggregate aliases

• Verifies constrained dotted count aliases do not expand and exists aliases are quoted as single identifiers.

tests/Database/DatabaseEloquentBuilderTest.php

DatabaseQueryBuilderTest.phpTest expression selection and vector grammar SQL +167/-27

Test expression selection and vector grammar SQL

• Covers explicit expression aliases, raw-expression behavior, multiple index hints, PostgreSQL and MariaDB vector SQL, bindings, and unsupported grammars.

tests/Database/DatabaseQueryBuilderTest.php

2022_02_21_000000_create_failed_jobs_table.phpAlign connection-configured failed-job fixture +6/-4

Align connection-configured failed-job fixture

• Uses string connection and queue fields, adds the composite lookup index, and declares migration return types.

tests/Database/migrations/connection_configured/2022_02_21_000000_create_failed_jobs_table.php

QueuedEventsTest.phpExercise unique-listener locks with real storage +12/-17

Exercise unique-listener locks with real storage

• Uses an actual array-store lock to verify release before handling and protection of a replacement lock.

tests/Events/QueuedEventsTest.php

PreventRequestForgeryExceptStub.phpAdd request-forgery exclusion fixture +29/-0

Add request-forgery exclusion fixture

• Exposes local and global exclusion matching for focused middleware tests.

tests/Http/Fixtures/PreventRequestForgeryExceptStub.php

HttpClientTest.phpTest redirect preservation across retry modes +48/-0

Test redirect preservation across retry modes

• Verifies synchronous and asynchronous retries return non-error redirects unchanged with both throw settings.

tests/Http/HttpClientTest.php

PreventRequestForgeryExceptTest.phpTest local and global CSRF exclusions +82/-0

Test local and global CSRF exclusions

• Covers paths, wildcards, full URLs, and a global exclusion independent of local exclusions.

tests/Http/Middleware/PreventRequestForgeryExceptTest.php

PreventRequestForgeryTest.phpTest CSRF origin and malformed-token behavior +175/-0

Test CSRF origin and malformed-token behavior

• Covers same-origin, same-site, cross-site, origin-only mode, missing headers, valid tokens, and malformed array input.

tests/Http/Middleware/PreventRequestForgeryTest.php

AfterQueryTest.phpTest keyed eager-loaded relationship results +42/-14

Test keyed eager-loaded relationship results

• Verifies associative keys returned by 'afterQuery' survive eager loading and improves relationship fixture types.

tests/Integration/Database/AfterQueryTest.php

AuthQueryAwarePolicyTest.phpAssert authorization expressions retain model IDs +1/-0

Assert authorization expressions retain model IDs

• Adds an assertion that expression-backed policy selection preserves the model column.

tests/Integration/Database/AuthQueryAwarePolicyTest.php

DatabaseLockTest.phpTest expired and foreign-owner lock release +15/-6

Test expired and foreign-owner lock release

• Confirms expired owners can delete their rows, foreign owners cannot, and concurrency errors still count as successful release.

tests/Integration/Database/DatabaseLockTest.php

EloquentVectorTest.phpIntegrate MariaDB vector storage and search +82/-0

Integrate MariaDB vector storage and search

• Creates real MariaDB vector columns and verifies casting, updates, indexing, distance selection, filtering, and ordering.

tests/Integration/Database/MariaDb/EloquentVectorTest.php

QueryBuilderTest.phpAdapt aliased-source tests to subqueries +2/-2

Adapt aliased-source tests to subqueries

• Uses explicit query selections after keyed raw expressions stop receiving inferred aliases.

tests/Integration/Database/QueryBuilderTest.php

QueuePayloadStorageTest.phpIntegrate raw queue payload persistence +58/-0

Integrate raw queue payload persistence

• Runs generated migrations and real queue operations to verify malformed payloads, byte preservation, and non-UUID failed identifiers.

tests/Integration/Database/Queue/QueuePayloadStorageTest.php

DatabaseSchemaBuilderTest.phpAdapt SQLite alias test to explicit subquery +1/-1

Adapt SQLite alias test to explicit subquery

• Preserves aliased-source coverage without relying on keyed raw-expression alias inference.

tests/Integration/Database/Sqlite/DatabaseSchemaBuilderTest.php

RouteServiceProviderHealthTest.phpTest escaped health-page Tailwind theme +11/-0

Test escaped health-page Tailwind theme

• Loads the real health route with a conflicting Blade directive and verifies the CSS rule survives.

tests/Integration/Foundation/Support/Providers/RouteServiceProviderHealthTest.php

QueueFailedTableCommandTest.phpTest generated failed-job migration schema +27/-0

Test generated failed-job migration schema

• Asserts string identifiers and queue metadata, raw payload storage, the composite index, and rollback SQL.

tests/Integration/Generators/QueueFailedTableCommandTest.php

ModelSerializationTest.phpExpand queued model serialization coverage +191/-50

Expand queued model serialization coverage

• Tests inherited relationship exclusion, morph-mapped collection serialization and restoration, relationship loading, order, custom collections, and stable serialized structure.

tests/Integration/Queue/ModelSerializationTest.php

NotificationChannelManagerTest.phpTest enum channels and repeated failures +69/-0

Test enum channels and repeated failures

• Covers backed-enum channel resolution and verifies repeated sends dispatch the correct success and failure events.

tests/Notifications/NotificationChannelManagerTest.php

NotificationFailedEventTest.phpTest notification failure deduplication lifecycle +79/-1

Test notification failure deduplication lifecycle

• Verifies provider-owned deduplication, nested and sequential sends, and cleanup after reported or thrown failures.

tests/Notifications/NotificationFailedEventTest.php

SerializesModelsTest.phpTest inherited relation exclusion +53/-2

Test inherited relation exclusion

• Updates class-level serialization expectations so 'WithoutRelations' on parent classes applies to children.

tests/Queue/SerializesModelsTest.php

2024_11_20_000000_create_failed_jobs_table.phpAlign queue failed-job migration fixture +5/-3

Align queue failed-job migration fixture

• Uses string identifiers and metadata columns and adds the composite failed-job index.

tests/Queue/migrations/2024_11_20_000000_create_failed_jobs_table.php

ClassMetadataCacheTest.phpTest separate inherited-attribute caches +27/-1

Test separate inherited-attribute caches

• Verifies parent traversal is opt-in, does not include trait attributes, and does not contaminate concrete-only cache results.

tests/Support/ClassMetadataCacheTest.php

SupportNumberTest.phpExpand number formatting regression coverage +108/-23

Expand number formatting regression coverage

• Covers fractions, negative zero, unit-boundary rounding, negative file sizes, nonfinite values, localized digits, pair steps, and callback contracts.

tests/Support/SupportNumberTest.php

SupportStrTest.phpTest multibyte boundaries and mask encodings +40/-0

Test multibyte boundaries and mask encodings

• Adds SJIS boundary regressions for last-occurrence and suffix operations plus Latin-1 masking coverage.

tests/Support/SupportStrTest.php

TestViewsTest.phpExercise compiled-view cleanup lifecycle +46/-3

Exercise compiled-view cleanup lifecycle

• Runs process and test setup before teardown, verifies worker-specific views are removed, and confirms sibling files survive.

tests/Testing/Concerns/TestViewsTest.php

TranslationMessageSelectorTest.phpExpand fractional translation selection coverage +5/-0

Expand fractional translation selection coverage

• Adds exact fractional conditions and pluralization assertions for English and Polish choices.

tests/Translation/TranslationMessageSelectorTest.php

Collection.phpAssert merge union result types +5/-0

Assert merge union result types

• Adds static assertions that eager and lazy collection merges preserve unions from both inputs.

types/Collections/Collection.php

Response.phpAssert JSON decoding flag mask type +12/-0

Assert JSON decoding flag mask type

• Adds a PHPStan fixture for all valid combinations of response decoding flags.

types/Http/Client/Response.php

Request.phpAdd Request static type fixture +25/-0

Add Request static type fixture

• Asserts enum defaults, nullable route results, route parameters, and JSON input return types.

types/Http/Request.php

Documentation (19) +201 / -23
ColumnDefinition.phpAlign schema starting-value annotation +1/-1

Align schema starting-value annotation

• Updates the auto-increment starting-value description to match upstream wording.

src/database/src/Schema/ColumnDefinition.php

authorization.mdDocument explicit authorization expression selection +2/-0

Document explicit authorization expression selection

• Explains how expression and subquery policy selections should be composed and how 'withCan' handles both.

src/docs/authorization.md

cache.mdDocument typed cache retrieval +15/-0

Document typed cache retrieval

• Describes typed getters, closure defaults, numeric-string conversion, and incompatible-value exceptions.

src/docs/cache.md

eloquent-mutators.mdDocument vector casting and nullable custom casts +26/-1

Document vector casting and nullable custom casts

• Adds 'AsVector' usage and clarifies that custom casts control their own null handling.

src/docs/eloquent-mutators.md

eloquent-relationships.mdDocument keyed eager-loaded relationships +16/-0

Document keyed eager-loaded relationships

• Shows how 'afterQuery' can return a keyed collection whose keys survive eager loading.

src/docs/eloquent-relationships.md

eloquent-resources.mdDocument fluent resource key preservation +6/-0

Document fluent resource key preservation

• Adds an example using 'preserveKeys' on an individual resource collection.

src/docs/eloquent-resources.md

events.mdClarify listener-wide uniqueness +3/-1

Clarify listener-wide uniqueness

• Clarifies that unique listeners are globally unique unless a per-event key is defined and completes example imports.

src/docs/events.md

http-client.mdDocument JSON flags, custom decoders, and retry types +27/-7

Document JSON flags, custom decoders, and retry types

• Documents decoding flags across response methods, boot-time defaults, custom-decoder precedence, and Throwable-based retry delays.

src/docs/http-client.md

migrations.mdGeneralize vector index documentation +1/-1

Generalize vector index documentation

• Clarifies that vector column indexing is not limited to PostgreSQL.

src/docs/migrations.md

notifications.mdDocument enum notification channels +2/-0

Document enum notification channels

• Notes that channel resolution accepts backed enums naming drivers or custom channel classes.

src/docs/notifications.md

porting-from-laravel.mdDocument CSRF middleware replacements +6/-0

Document CSRF middleware replacements

• Explains how to replace Laravel's deprecated CSRF middleware aliases and configuration method.

src/docs/porting-from-laravel.md

queries.mdDocument index hints, selectExpression, and MariaDB vectors +23/-1

Document index hints, selectExpression, and MariaDB vectors

• Adds multiple-index examples, explicit expression selection guidance, and MariaDB vector-query support.

src/docs/queries.md

queues.mdExpand queue serialization and lifecycle documentation +38/-3

Expand queue serialization and lifecycle documentation

• Documents morph-map serialization, inherited 'WithoutRelations', relationship restoration, and queue startup, pop, stop, and exception-release events.

src/docs/queues.md

routing.mdDocument conditional CORS bypass +22/-1

Document conditional CORS bypass

• Adds 'HandleCors::skipWhen' setup, behavior, and interaction with dynamic CORS configuration.

src/docs/routing.md

search.mdDocument MariaDB vector search and AsVector +8/-6

Document MariaDB vector search and AsVector

• Extends semantic-search guidance to MariaDB 11.7+, uses 'AsVector', and limits extension setup to PostgreSQL.

src/docs/search.md

README.mdClarify unsupported Laravel CSRF aliases +1/-1

Clarify unsupported Laravel CSRF aliases

• Documents the replacement middleware and configuration API for deprecated Laravel aliases.

src/foundation/README.md

FoundationServiceProvider.phpExplain deferred queue callback draining +2/-0

Explain deferred queue callback draining

• Documents why Hypervel's coroutine-exit deferred jobs must not use Laravel's exclusion behavior.

src/foundation/src/Providers/FoundationServiceProvider.php

BatchesTableCommand.phpPreserve bundled batch migration detection +1/-0

Preserve bundled batch migration detection

• Documents support for Laravel applications retaining batch tables in older bundled migration filenames.

src/queue/src/Console/BatchesTableCommand.php

FailedTableCommand.phpPreserve bundled failed-job migration detection +1/-0

Preserve bundled failed-job migration detection

• Documents support for failed-job tables in older bundled migration filenames.

src/queue/src/Console/FailedTableCommand.php

Other (5) +4 / -24
databases.ymlRemove database service host-port publications +0/-12

Remove database service host-port publications

• Stops publishing MySQL, MariaDB, and PostgreSQL service ports because containerized jobs use service DNS and internal ports.

.github/workflows/databases.yml

redis.ymlRemove Redis and Valkey host ports +0/-4

Remove Redis and Valkey host ports

• Removes unnecessary host-port mappings while retaining service health checks.

.github/workflows/redis.yml

reverb.ymlRemove Reverb Redis host port +0/-2

Remove Reverb Redis host port

• Keeps the Redis service internal to the workflow network.

.github/workflows/reverb.yml

scout.ymlRemove search-service host ports +0/-4

Remove search-service host ports

• Removes Meilisearch and Typesense host publications from container-based Scout jobs.

.github/workflows/scout.yml

0001_01_01_000007_testbench_create_failed_jobs_table.phpAlign Testbench failed-job schema +4/-2

Align Testbench failed-job schema

• Uses string connection and queue columns and adds the failed-job lookup index.

src/testbench/hypervel/migrations/0001_01_01_000007_testbench_create_failed_jobs_table.php

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Raw selections lose requested aliases 🐞 Bug ≡ Correctness
Description
select() now treats a keyed ExpressionContract as an unkeyed column because only queryable
subqueries consume the array key. Passing ['is_admin' => DB::raw('role = 1')] therefore compiles
the raw text without the requested alias, changing hydrated result keys for every keyed raw
selection.
Code

src/database/src/Query/Builder.php[L272-274]

-            if (is_string($as) && $column instanceof ExpressionContract) {
-                $this->selectExpression($column, $as);
-            } elseif (is_string($as) && $this->isQueryable($column)) {
+            if (is_string($as) && $this->isQueryable($column)) {
Evidence
The current loop discards the key whenever the value is not queryable, and isQueryable() does not
include expression objects. The dedicated selectExpression() method shows that aliasing requires
an explicit call, while the updated test embeds the alias inside the raw SQL instead of verifying
the keyed API.

src/database/src/Query/Builder.php[269-276]
src/database/src/Query/Builder.php[302-306]
src/database/src/Query/Builder.php[4257-4263]
tests/Database/DatabaseQueryBuilderTest.php[6209-6214]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Keyed raw expressions passed to `select()` no longer receive the alias supplied by their array key because the expression-specific branch was removed.

## Fix Focus Areas
- src/database/src/Query/Builder.php[269-276]

## Recommended Fix
Restore the keyed `ExpressionContract` branch before the queryable-subquery branch and pass the expression and array key to `selectExpression()`. Add a regression test using a raw expression that does not contain its own SQL alias.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Raw additions omit model columns 🐞 Bug ≡ Correctness
Description
addSelect() removed the expression-specific branch that initialized the default selection before
appending the aliased expression. On a fresh query, adding a keyed raw value now selects only that
expression, so Eloquent models are hydrated without their normal table columns as well as without
the requested alias.
Code

src/database/src/Query/Builder.php[L435-438]

-            if (is_string($as) && $column instanceof ExpressionContract) {
-                if (is_null($this->columns)) {
-                    $this->select($this->getDefaultSelectColumn());
-                }
Evidence
Only keyed subqueries now initialize the default selection; keyed expressions fall through and are
appended to a null column list without consuming their key. The changed regression test confirms the
resulting query contains only the expression and works around the missing alias by writing `as
is_admin` directly in the raw value.

src/database/src/Query/Builder.php[428-445]
src/database/src/Query/Builder.php[302-306]
src/database/src/Query/Builder.php[4257-4263]
tests/Database/DatabaseQueryBuilderTest.php[6217-6222]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A keyed raw expression passed to `addSelect()` on a query without an existing selection no longer initializes the default table columns and also loses its array-key alias.

## Fix Focus Areas
- src/database/src/Query/Builder.php[428-445]

## Recommended Fix
Restore an `ExpressionContract` branch that initializes the default selection when `columns` is null and then calls `selectExpression()` with the supplied key. Reinstate a regression test asserting both the table wildcard and generated alias without placing `as` inside the raw SQL.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: 🧠 Deep: This is an unusually dense cross-cutting sync spanning 94 files and 305 independent hunks, including database/query logic, casting, HTTP/security middleware, queue migrations, formatting, and framework internals, creating many independent opportunities for subtle defects.

Grey Divider

Tip of the day
💡 Did you know, you can switch off images and animations for a plain-text comment

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/database/src/Query/Builder.php
Comment thread src/database/src/Query/Builder.php
@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown

Greptile Summary

This PR synchronizes a broad set of Laravel framework updates while retaining Hypervel-specific behavior across database vectors, query authorization, queues, HTTP retries, request-forgery validation, model serialization, string handling, and number formatting.

  • Adds PostgreSQL and MariaDB vector casting and similarity-query support.
  • Preserves model projections in expression-backed authorization selections and treats aliases as single identifiers.
  • Updates queue and failed-job migrations to preserve raw payloads and adds failed-job lookup indexing.
  • Corrects synchronous after-response handler forwarding and asynchronous HTTP retry results.
  • Supports inherited WithoutRelations metadata and integer morph aliases.
  • Improves multibyte string boundaries and localized number rounding.
  • Expands integration and regression coverage across the changed subsystems.

Confidence Score: 4/5

The PR should not merge until generated failed-job storage either preserves or explicitly rejects identifiers longer than the new column limit.

The generated migration narrows identifiers to a bounded string while the failed-job provider accepts arbitrary non-empty string identifiers, so failure logging can itself fail and discard diagnostic job data.

Files Needing Attention: src/queue/src/Console/stubs/failed_jobs.stub, src/queue/src/Failed/DatabaseUuidFailedJobProvider.php

Important Files Changed

Filename Overview
src/database/src/Eloquent/Casts/AsVector.php Adds nullable PostgreSQL/MariaDB vector conversion and float32-aware dirty comparison without exposing raw vector input to SQL.
src/database/src/Query/Builder.php Moves vector SQL compilation into grammars, adds MariaDB support, and makes raw-expression selection aliases explicit.
src/auth/src/AuthServiceProvider.php Preserves model columns and explicit aliases for expression-backed authorization selections.
src/http/src/Client/PendingRequest.php Preserves successful and redirect responses during asynchronous retry processing while retaining exception-based retry behavior.
src/foundation/src/Http/Middleware/PreventRequestForgery.php Allows malformed token types to reach the normal constant-time token validation and mismatch response.
src/contracts/src/Database/ModelIdentifier.php Preserves integer morph aliases in serialized identifiers while retaining the nullable-string restoration interface.
src/reflection/src/ClassMetadataCache.php Separates concrete and inherited class-attribute presence caches for inherited queue relation exclusions.
src/cache/src/DatabaseLock.php Replaces the ownership read and delete sequence with one owner-qualified deletion that safely handles replacement owners.
src/support/src/Str.php Makes changed boundary and mask operations consistent with their selected multibyte encoding.
src/support/src/Number.php Corrects small fractions, localized zero rendering, negative-zero suppression, and unit-boundary rounding.
src/queue/src/Console/stubs/failed_jobs.stub Preserves raw payload text and adds filtering indexes, but constrains provider-accepted string identifiers to 255 characters.

Fix all with Greploop Fix All in Claude Code Fix All in Codex

Reviews (1): Last reviewed commit: "Select Arabic-Indic digits explicitly in..." | Re-trigger Greptile

$table->text('queue');
$table->jsonb('payload');
// Payloads may supply identifiers that are not UUIDs.
$table->string('uuid')->unique();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Failed identifiers can truncate

The failed-job provider accepts any non-empty string from a payload as its identifier, but this migration stores it in a default-width 255-character column. If a raw or externally produced payload has a longer identifier, logging the failed job can raise a truncation or data-too-long error, losing the diagnostic record. Please either validate the identifier length in the provider or use a column type that preserves every accepted identifier.

Knowledge Base Used: Queues, buses, and events

Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The storage limit is real, but this PR does not introduce a narrower identifier limit: it replaces the previous UUID column with Laravel's standard uniquely indexed string column. Framework-generated job UUIDs are 36 characters. Exceeding the default 255-character limit requires a custom payload identifier outside that storage capacity.

We are retaining the indexed string column. Adding provider validation would still reject the failed-job record, while supporting arbitrarily long identifiers would require a different storage/indexing design without an established application requirement. Custom producers must supply identifiers that fit their configured failed-job schema. No change proposed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s fair. I rechecked the provider and migration: this is the framework-standard indexed string schema, and changing from uuid to string widens the supported range rather than introducing a narrower limit. Although the provider does not explicitly reject longer custom identifiers, supporting unbounded identifiers would require a separate storage/indexing design and is outside this PR’s scope. I’m withdrawing this finding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant