spatie/pest-plugin-route-testing
Easily test every GET route in your Laravel app with Pest. Assert all routes return successful responses, include or exclude patterns, and bind models for routes with route model bindings.
routeTesting()->assertSuccessful() in CI catches the class of breakage that slips through unit tests — deleted views, renamed controllers, misordered middleware, broken route caching, orphaned redirects. This is a release-blocking gate you can adopt cheaply, not a coverage program.route:list — roughly 50–100 lines. That is a real option, but it becomes your code to maintain across Laravel and Pest upgrades. Adopting an MIT-licensed Spatie package with a narrow surface is the lower-ownership choice; a fork is a credible fallback if the package stalls.assertRedirect('new-section/*') pattern is a direct fit for URL restructuring, SEO migrations, and legacy-path retirement — it turns "did we map all the old URLs?" into a testable claim rather than a spreadsheet.Adopt when most of these hold:
composer require.setUp() (e.g., actingAs() plus a couple of bind() calls).Look elsewhere — or defer — when:
route:list data provider instead; it is materially the same thing and avoids a test-framework migration you did not want.user/{user}-style paths yields a large skip list out of the box. If resolving that list is a big project, the package's headline value shrinks accordingly.For executives — one paragraph: This is a small, free, dev-only testing utility for our Laravel application. It turns "did we break any page?" from a manual pre-release click-through into an automated check that runs on every code change, and it costs us roughly a day of engineering to adopt with no production footprint and no ongoing license. The honest framing is that it raises the floor, not the ceiling: it proves pages respond correctly, not that they work correctly. We should present it as reducing a specific, recurring class of release risk — broken routes reaching customers — and as freeing QA time for higher-value testing, not as a coverage milestone.
For engineering — the ask: Add a dev-only dependency and one test file. It resolves the route table via Laravel's public route:list API into Pest data providers, issues each GET through the standard HTTP test harness, and delegates assertions to TestResponse — so include()/exclude() wildcards, bind(), setUp(), and snapshot assertions all behave exactly as the team already expects. Reversal is one composer remove commit. Two caveats to state plainly rather than bury: (1) it requires Pest, and the version we can use is dictated by our Pest/PHP/Laravel line — settle that first; (2) GET-only plus bindings-skipped-by-default means "all routes pass" is true-by-construction only over the subset we resolved, so the skip list is the actual roadmap for follow-up work.
The one risk to name up front: coverage illusion. A green badge that reads "all routes pass" while a meaningful set was silently skipped is worse than no badge, because stakeholders will treat it as assurance. Mitigate with a product decision, not a technical one: publish the skip count, assign an owner to burn it down, and never report route-test results without the skipped number attached.
How can I help you explore Laravel packages today?