- What is tenantcloud/laravel-cors used for?
- It is a Laravel package for handling Cross-Origin Resource Sharing (CORS). It provides middleware and configuration to control allowed origins, methods, headers, and credentials so APIs can respond safely to browser preflight and cross-origin requests. It is based on spatie/laravel-cors.
- How do I install tenantcloud/laravel-cors in a Laravel application?
- Install it with Composer, then publish or verify the package configuration and register the middleware as documented. For v3.0.0, the host application must already run Laravel 12 and PHP 8.4+. After installation, validate preflight and credentialed-request behavior in the target environment.
- Which Laravel and PHP versions does tenantcloud/laravel-cors support?
- v3.0.0 is coupled to Laravel 12 and PHP 8.4+. It drops support for older Laravel and PHP versions. Teams on older stacks should remain on v2.4.1 unless they have an approved platform upgrade path.
- Does tenantcloud/laravel-cors work with Laravel 10 or Laravel 11?
- Not with v3.0.0, which requires Laravel 12 and PHP 8.4+. Applications on Laravel 10 or 11 should stay on v2.4.1 until the host application is upgraded. Treat a move to v3.0.0 as part of a Laravel 12/PHP 8.4 platform upgrade, not a package-only change.
- How do I configure allowed origins, methods, headers, and credentials?
- The package is configuration-driven: publish or verify its CORS configuration and register the middleware as documented. Define the allowed origins, methods, headers, and credential behavior your API requires. Before relying on it, verify support for your policy needs such as multiple origins, wildcard restrictions, preflight caching, and per-route rules. Regression-test browser preflight and credentialed requests after changes.
- Is tenantcloud/laravel-cors a replacement for Laravel's native CORS handling?
- It is a Laravel-oriented CORS component based on spatie/laravel-cors, providing middleware and configuration. Whether it adds value over Laravel 12's native CORS support or existing middleware is a key adoption question that should be confirmed before making it a strategic dependency. If the framework or application already handles CORS, avoid duplicate middleware and conflicting configuration.
- What should I test before deploying tenantcloud/laravel-cors to production?
- Test browser preflight OPTIONS requests, actual cross-origin requests, credentialed requests, and allowed versus disallowed origins, methods, and headers. Confirm that CORS headers match your policy and that no duplicate CORS middleware is active. After a major-version update, run regression tests specifically around CORS headers, preflight handling, credentials, and allowed origins.
- How do I migrate from tenantcloud/laravel-cors v2.4.1 to v3.0.0?
- First upgrade the host application to Laravel 12 and PHP 8.4, then update the package. Revalidate the CORS configuration and middleware registration, review the changelog for behavior changes beyond platform requirements, and run regression tests. Plan a rollback path in case v3.0.0 causes CORS regressions in production.
- Is tenantcloud/laravel-cors actively maintained and suitable for production?
- The provided evaluation does not establish the package's maintenance cadence, security response process, license, or support window for v3.0.0. Confirm those details and whether v3.0.0 is a one-off compatibility release or part of an actively supported line. Because v3.0.0 is platform-coupled to Laravel 12 and PHP 8.4, treat it as a dependency that requires changelog review and regression testing.
- Can tenantcloud/laravel-cors conflict with existing CORS middleware?
- Yes. If Laravel or the application already provides CORS handling, duplicate middleware or conflicting configuration can cause hard-to-debug browser failures. Document the target architecture before adoption and ensure only one CORS layer is active or that the layers are coordinated. This is especially important when replacing or supplementing native CORS handling.