# fruitcake/laravel-cors

Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application

Repository: https://github.com/fruitcake/laravel-cors
Canonical: https://ross.abutalabs.com/products/laravel-cors
Language: PHP
License: MIT
License Family: permissive
Topics: php, laravel, middleware, cors, hacktoberfest
Archived: true
Last push: 2023-02-16T09:46:34+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4704, "days_push": 1294, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6235, forks 604 (observed 2026-08-28T04:09:40.793944+00:00)

## What it is
A Laravel package that adds Cross-Origin Resource Sharing (CORS) headers support via middleware, handling pre-flight OPTIONS requests and configurable per-route CORS. It is now deprecated because CORS middleware is included in Laravel framework core since Laravel 9.2.

## Use cases
- enable CORS headers in a Laravel API
- handle CORS pre-flight OPTIONS requests in Laravel
- allow cross-origin requests from a frontend to a Laravel backend
- restrict CORS to specific routes in Laravel
- configure allowed origins and headers for a Laravel app

## When to choose
- you are on Laravel 8 or earlier and need CORS support
- you maintain a legacy Laravel app still using this package

## When to avoid
- you are on Laravel 9.2 or later - use the built-in Illuminate\Http\Middleware\HandleCors instead
- you need CORS for a non-Laravel PHP project - use fruitcake/php-cors directly

## Facets
- artifact type: library
- maturity: maintenance
- function: middleware, http-server, security
- domain: web-development, backend, apis, security
- platform: php
- tags: cors, laravel-package, deprecated-in-favor-of-core, http-headers, laravel

## Member repositories
- fruitcake/laravel-cors (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:40.793944+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:47:12.364674+00:00, confidence not recorded.
  - readme: https://github.com/fruitcake/laravel-cors (fetched 2026-08-28T04:09:40.793944+00:00, sha 2d9f9e8c7eae)
- Data as of 2026-08-30T08:39:29.467469+00:00.
