Skip to content

Merge pull request from dicoding-dev/pre-release/4.2.95 - #59

Merged
agissept merged 3 commits into
masterfrom
pre-release/4.2.95
Sep 17, 2026
Merged

agissept merged 3 commits into
masterfrom
pre-release/4.2.95

Conversation

@agissept

Copy link
Copy Markdown
Member

Pre-release 4.2.95 — dibangun di atas 4.2.94.

Tasks

  • 2.8 — Routing (part 1): tambah L13 route-middleware engine berjalan berdampingan dgn legacy filters (no-middleware routes short-circuit, aman). Controller::middleware() bridging ke controller filters; MiddlewareNameResolver + SortedMiddleware; honour disableFilters() di engine baru.
  • 2.15 — Pagination (part 2): re-add getter alias pre-L13 sebagai @deprecated bridge.

Notes

  • Fork-only, additive: engine baru tidak mengubah perilaku route lama (66 test rute tak berubah).
  • Merge-tree bersih tanpa konflik.

🤖 Generated with Claude Code

@agissept agissept self-assigned this Sep 17, 2026
agissept and others added 3 commits September 17, 2026 16:38
…rs (task 2.8, part 1)

Introduce a running route-middleware stack so the app can migrate filters ->
middleware route-by-route, WITHOUT removing any filter yet.

- Route::middleware()/gatherMiddleware() store middleware names on the route.
- Router middleware registry (aliasMiddleware/middlewareGroup/middlewarePriority)
  + resolveMiddleware/gatherRouteMiddleware/uniqueMiddleware.
- runRouteWithinStack() runs the route through Illuminate\Pipeline\Pipeline
  (already present from task 1.2) INSIDE the legacy before/after filter bracket.
- New leaves copied from L13: MiddlewareNameResolver (alias/group/':' params),
  SortedMiddleware (priority sort).
- dispatchToRoute: one-line swap route->run($request) -> runRouteWithinStack().

Safety: routes with no ->middleware() short-circuit to a plain run() -> behavior
is identical for every existing (filter-only) route (66 existing routing tests
unchanged). Filters stay intact; middleware and filters use SEPARATE registries
so the ':' param syntax does not collide. Exceptions propagate to the existing
top-level handler (base Pipeline rethrows); the HTTP-aware routing Pipeline is
deferred to SCC-1.

Deferred (SCC-1 lockstep): removing the filter surface, Http\Kernel + middleware
groups/priority config, controller middleware -- these land together with the
app's filters->middleware conversion that consumes this via the dev-13 alias.

Tests: +testRouteMiddlewareRunsAndWraps (closure/short-circuit/alias/param/group),
+testRouteMiddlewareCoexistsWithFilters. tests/Routing green (68), Foundation/Http green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit aec112e)
…lters (task 2.8)

Add Controller::middleware($middleware, array $options = []) — matches L13's exact
signature. Bridges to beforeFilter() so controller-declared middleware runs via the
existing ControllerDispatcher filter path until the routing engine is swapped to
stock L13. Lets the app flip $this->beforeFilter('x') -> $this->middleware('x')
(options incl. only/except carry over unchanged after the swap). Additive;
beforeFilter() untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit da7dfc9)
…(task 2.8)

runRouteWithinStack() gathered+ran route middleware unconditionally, so the new
engine ignored Router::disableFilters() — which the testing env enables by default
(RoutingServiceProvider) and which many integration tests toggle via Route::enable/
disableFilters(). Since flipped routes now attach their guards as ->middleware(),
skip the pipeline when $filtering is off, mirroring the legacy filter path. Restores
filters-off-in-testing semantics for flipped routes (e.g. an unauthenticated request
reaches the controller instead of the oauth2 middleware's 401).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 3d77e2e)
@agissept
agissept merged commit c7f831a into master Sep 17, 2026
2 checks passed
@agissept
agissept deleted the pre-release/4.2.95 branch September 17, 2026 09:42
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