{"action":"opened","issue":{"url":"https://api.github.com/repos/barryvdh/laravel-cors/issues/28","labels_url":"https://api.github.com/repos/barryvdh/laravel-cors/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/barryvdh/laravel-cors/issues/28/comments","events_url":"https://api.github.com/repos/barryvdh/laravel-cors/issues/28/events","html_url":"https://github.com/barryvdh/laravel-cors/issues/28","id":54660562,"number":28,"title":"[L5] What is correct syntax to load custom config?","user":{"login":"jaoued","id":2301050,"avatar_url":"https://avatars.githubusercontent.com/u/2301050?v=3","gravatar_id":"","url":"https://api.github.com/users/jaoued","html_url":"https://github.com/jaoued","followers_url":"https://api.github.com/users/jaoued/followers","following_url":"https://api.github.com/users/jaoued/following{/other_user}","gists_url":"https://api.github.com/users/jaoued/gists{/gist_id}","starred_url":"https://api.github.com/users/jaoued/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaoued/subscriptions","organizations_url":"https://api.github.com/users/jaoued/orgs","repos_url":"https://api.github.com/users/jaoued/repos","events_url":"https://api.github.com/users/jaoued/events{/privacy}","received_events_url":"https://api.github.com/users/jaoued/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-17T12:35:06Z","updated_at":"2015-01-17T12:35:06Z","closed_at":null,"body":"Hi @barryvdh ,\r\n\r\nI successfully installed package et load provider and middleware.\r\n\r\nTo load custom configuration, i added this in ConfigServiceProvider:\r\n\r\n```php\r\npublic function register()\r\n{\r\n       config([\r\n            'laravel-cors.defaults' => [\r\n                'supportsCredentials' => false,\r\n                'allowedOrigins'      => [],\r\n                'allowedHeaders'      => [],\r\n                'allowedMethods'      => [],\r\n                'exposedHeaders'      => [],\r\n                'maxAge'              => 0,\r\n                'hosts'               => [],\r\n            ],\r\n            'laravel-cors.paths'    => [\r\n                '*' => [\r\n                    'allowedOrigins' => ['*'],\r\n                    'allowedHeaders' => ['Content-Type'],\r\n                    'allowedMethods' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],\r\n                    'maxAge'         => 3600,\r\n                    'hosts'          => ['api.*'],\r\n                ],\r\n            ]\r\n        ]);\r\n}\r\n```\r\n\r\nIs this syntax is correct ?\r\n\r\nBecause when i return laravel-cors config, i show default configuration : \r\n```php\r\n// Return Laravel-cors configuration\r\nConfig::get('laravel-cors');\r\n```\r\n\r\nOutput:\r\n```json\r\n{\r\n    \"defaults\": {\r\n        \"supportsCredentials\": false,\r\n        \"allowedOrigins\": [],\r\n        \"allowedHeaders\": [],\r\n        \"allowedMethods\": [],\r\n        \"exposedHeaders\": [],\r\n        \"maxAge\": 0,\r\n        \"hosts\": []\r\n    },\r\n    \"paths\": {\r\n        \"api/*\": {\r\n            \"allowedOrigins\": [\r\n                \"*\"\r\n            ],\r\n            \"allowedHeaders\": [\r\n                \"*\"\r\n            ],\r\n            \"allowedMethods\": [\r\n                \"*\"\r\n            ],\r\n            \"maxAge\": 3600\r\n        },\r\n        \"*\": {\r\n            \"allowedOrigins\": [\r\n                \"*\"\r\n            ],\r\n            \"allowedHeaders\": [\r\n                \"Content-Type\"\r\n            ],\r\n            \"allowedMethods\": [\r\n                \"POST\",\r\n                \"PUT\",\r\n                \"GET\",\r\n                \"DELETE\"\r\n            ],\r\n            \"maxAge\": 3600,\r\n            \"hosts\": [\r\n                \"api.*\"\r\n            ]\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n\r\nThanks"}}