- How do I install canvural/laravel-e2e-routes in a Laravel app?
- Install it with Composer by running composer require canvural/laravel-e2e-routes. Then follow the package README for any service provider registration, configuration publishing, or environment setup. The package is designed for minimal configuration in Laravel applications.
- How do I define routes that are only available during E2E testing in Laravel?
- You register E2E-only endpoints through the package's test-only route registration rather than your normal production routes. The package applies environment safeguards so those routes are available during end-to-end testing but kept out of production. This lets browser tests exercise realistic Laravel flows without exposing endpoints to users.
- Can I use laravel-e2e-routes with Cypress and Playwright?
- Yes. Laravel E2E Routes works with popular browser testing tools such as Cypress, Playwright, and Dusk. It generates a JSON route manifest so those tools can resolve named routes and URLs without hardcoding paths.
- How does the JSON route manifest work in Laravel E2E Routes?
- The package generates a JSON route manifest for your Laravel application using an artisan command. Tests can read that manifest to resolve named routes and URLs instead of hardcoding paths. Configurable filtering lets you keep sensitive routes out of the generated file.
- How do I exclude sensitive routes from the E2E route manifest?
- Use the package's configurable filtering to exclude sensitive routes before generating the JSON manifest. This helps keep admin, auth, or internal endpoints out of test artifacts. Review the filter rules whenever you add new routes.
- Which Laravel versions does canvural/laravel-e2e-routes support?
- The supported Laravel and PHP version constraints are declared in the package's composer.json and README. Check those constraints before installing to confirm compatibility with your Laravel application. The package integrates with Laravel's router and middleware, but exact version support should come from the repository.
- Is it safe to use laravel-e2e-routes in production?
- The package is designed to keep E2E endpoints out of production by using environment safeguards around test-only route registration. You should still review your configuration and route filtering before deploying. Avoid exposing generated manifests publicly and confirm test routes are unavailable in production.
- Can I apply Laravel middleware to E2E-only routes?
- Yes. Because the package integrates with Laravel's router and middleware, you can apply middleware to E2E-only routes as you would with normal routes. This lets you add auth or other guards around test endpoints during end-to-end runs.
- Do I still need to hardcode URLs in Cypress or Playwright tests?
- No. The JSON route manifest lets Cypress, Playwright, or Dusk resolve named routes and URLs without hardcoding paths. You generate the manifest with the artisan command and point your tests at it.
- How does this package compare to using Laravel Dusk or manual test routes?
- Laravel Dusk is a browser testing tool, while Laravel E2E Routes focuses on exposing test-only routes and generating a route manifest for browser test suites. It complements tools like Dusk, Cypress, and Playwright by keeping E2E endpoints separate from production routing and avoiding hardcoded URLs. Use it when you need realistic test routes without exposing them to users.