Skip to content

Instantly share code, notes, and snippets.

@animepauly
Created August 2, 2017 14:59
Show Gist options
  • Save animepauly/13c356da75cc6245f83c8fe1f3be9305 to your computer and use it in GitHub Desktop.
Save animepauly/13c356da75cc6245f83c8fe1f3be9305 to your computer and use it in GitHub Desktop.
beforeFilter() method in APIController()
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