# fruitcake/laravel-cors

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/fruitcake-laravel-cors).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

6,240 stars · 607 forks · PHP · MIT · archived

## Links

- GitHub: https://github.com/fruitcake/laravel-cors
- awesome-repositories: https://awesome-repositories.com/repository/fruitcake-laravel-cors.md

## Topics

`cors` `hacktoberfest` `laravel` `middleware` `php`

## Description

This project is a CORS header manager and security plugin for Laravel. It functions as middleware that adds Cross-Origin Resource Sharing headers to HTTP responses to control how external domains access a Laravel backend.

The software manages cross-origin request policies by defining allowed origins, methods, and headers. It handles pre-flight requests and allows for the restriction of sharing policies based on specific routes.

The package provides API access control and cross-domain resource sharing by integrating custom header logic into the Laravel request lifecycle.

## Tags

### Security & Cryptography

- [Cross-Origin Resource Sharing (CORS) Policies](https://awesome-repositories.com/f/security-cryptography/cross-origin-resource-sharing-cors-policies.md) — Provides a comprehensive mechanism to restrict or allow web requests from different origins using CORS headers. ([source](https://github.com/fruitcake/laravel-cors#readme))
- [API Access Control](https://awesome-repositories.com/f/security-cryptography/api-access-control.md) — Implements granular authorization policies for web service endpoints to control external origin access.
- [CORS Header Management](https://awesome-repositories.com/f/security-cryptography/cors-header-management.md) — Defines allowed origins, methods, and headers for incoming requests based on the CORS protocol.
- [CORS Header Restrictions](https://awesome-repositories.com/f/security-cryptography/cors-header-restrictions.md) — Defines which custom request headers are permitted to ensure authorization tokens and credentials are accepted. ([source](https://github.com/fruitcake/laravel-cors#readme))
- [Route-Based Access Restrictions](https://awesome-repositories.com/f/security-cryptography/domain-access-restrictions/request-access-restrictions/resource-access-restrictions/route-based-access-restrictions.md) — Enforces cross-origin access restrictions based on specific URL patterns. ([source](https://github.com/fruitcake/laravel-cors#readme))

### Networking & Communication

- [CORS Header Injection](https://awesome-repositories.com/f/networking-communication/proxy-headers/cors-header-injection.md) — Automatically appends Access-Control-Allow-Origin headers to HTTP responses to manage browser same-origin policies.

### Web Development

- [Cross-Domain Request Handling](https://awesome-repositories.com/f/web-development/cross-domain-request-handling.md) — Implements browser patterns to enable secure data exchange between clients and servers on different origins.
- [CORS Middleware](https://awesome-repositories.com/f/web-development/laravel-integrations/cors-middleware.md) — Provides a Laravel middleware that adds Cross-Origin Resource Sharing headers to HTTP responses.
- [CORS Pre-Flight Handling](https://awesome-repositories.com/f/web-development/request-handling/cors-pre-flight-handling.md) — Intercepts OPTIONS requests to return validity headers before the actual application logic is executed.
- [Route-Based CORS Filtering](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-utilities/http-header-manipulators/http-request-header-inspectors/header-based-routing/route-based-cors-filtering.md) — Applies cross-origin restrictions based on a defined list of URL patterns within the routing layer.
- [Laravel Integrations](https://awesome-repositories.com/f/web-development/laravel-integrations.md) — Integrates custom CORS header logic into the Laravel request lifecycle via middleware.
- [CORS Configuration](https://awesome-repositories.com/f/web-development/laravel-integrations/cors-configuration.md) — Manages Cross-Origin Resource Sharing headers specifically within Laravel applications.
- [Request-Response Interceptors](https://awesome-repositories.com/f/web-development/request-response-interceptors.md) — Uses framework interceptors to modify outgoing HTTP responses globally.

### Software Engineering & Architecture

- [Configuration-Driven Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/configuration-driven-dispatchers.md) — Implements a pattern that uses configuration files to route requests to specific CORS handlers.
