Created
August 2, 2017 14:59
-
-
Save animepauly/13c356da75cc6245f83c8fe1f3be9305 to your computer and use it in GitHub Desktop.
beforeFilter() method in APIController()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function beforeFilter(Event $event) | |
{ | |
parent::beforeFilter($event); | |
$this->response->cors($this->request) | |
->allowOrigin(['http://adunit.adphenom.com/']) | |
->allowMethods(['GET', 'POST']) | |
->allowHeaders(['X-API-Auth-Token']) | |
->allowCredentials() | |
->exposeHeaders(['Link']) | |
->maxAge(300) | |
->build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment