{"id":18600477,"url":"https://github.com/abellion/laravel-cors","last_synced_at":"2026-04-30T13:33:05.574Z","repository":{"id":56939345,"uuid":"70433895","full_name":"abellion/laravel-cors","owner":"abellion","description":"Add CORS to your Laravel/Lumen app in 2 steps","archived":false,"fork":false,"pushed_at":"2017-02-09T17:04:38.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-30T12:52:13.409Z","etag":null,"topics":["laravel","laravel-cors","lumen"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abellion.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-09T22:22:51.000Z","updated_at":"2020-04-25T17:37:16.000Z","dependencies_parsed_at":"2022-08-21T06:50:51.576Z","dependency_job_id":null,"html_url":"https://github.com/abellion/laravel-cors","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/abellion/laravel-cors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abellion%2Flaravel-cors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abellion%2Flaravel-cors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abellion%2Flaravel-cors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abellion%2Flaravel-cors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abellion","download_url":"https://codeload.github.com/abellion/laravel-cors/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abellion%2Flaravel-cors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32466333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-cors","lumen"],"created_at":"2024-11-07T02:04:09.395Z","updated_at":"2026-04-30T13:33:05.537Z","avatar_url":"https://github.com/abellion.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Laravel CORS\n\n## Add CORS to your Laravel/Lumen app in 2 steps :\n\n#### Require the package :\n```\ncomposer require abellion/laravel-cors\n```\n\n#### Add the service provider to your app :\n```php\nAbellion\\Cors\\LaravelServiceProvider::class\n```\n\n- **Laravel** : In the `providers` array of the ```config/app.php``` file\n- **Lumen** : In the ```bootstrap/app.php``` file using the ```$app-\u003eregister();``` method.\n\n**You're all set ! All origins are allowed by default. If you want to config your own domains, see bellow.**\n\n## Configuring allowed origins :\n\nBy default all origins are allowed. You can add your own config by modifying the ```ORIGINS``` array from the ```OriginsMiddleware``` class :\n\n```php\nuse Abellion\\Cors\\Middleware\\OriginsMiddleware;\n\nOriginsMiddleware::$ORIGINS = [\n    \"/https:\\/\\/(www\\.)?([a-z0-9]+\\.)?mydomain\\.(com|fr)/\",\n    \"/http(s)?:\\/\\/(www\\.)?localhost(:[0-9]+)?/\"\n];\n```\n\nAll origins that match one of the regex will be added. In this example ```localhost``` and ```mydomain``` are allowed.\n\n## Configuring other headers :\n\n```php\nuse Abellion\\Cors\\Middleware\\OptionsMiddleware;\n\nOptionsMiddleware::$OPTIONS['Access-Control-Allow-Methods'] = \"POST, PUT, DELETE, GET, OPTIONS, PATCH, HEAD\";\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabellion%2Flaravel-cors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabellion%2Flaravel-cors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabellion%2Flaravel-cors/lists"}