Skip to content

Instantly share code, notes, and snippets.

@findli
Forked from carcinocron/ddcors.php
Created April 2, 2021 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save findli/daec0d3170453899909d2f7f3ca4a0c1 to your computer and use it in GitHub Desktop.
Save findli/daec0d3170453899909d2f7f3ca4a0c1 to your computer and use it in GitHub Desktop.
CORS usable dd (laravel)
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: *');
header('Access-Control-Allow-Headers: *');
dd(__FILE__);
// or use a function
function ddcors(...$args) {
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: *');
header('Access-Control-Allow-Headers: *');
dd(...$args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment