e
Showing
2 changed files
with
8 additions
and
9 deletions
| ... | @@ -131,19 +131,12 @@ class ApiController extends Controller | ... | @@ -131,19 +131,12 @@ class ApiController extends Controller |
| 131 | $apiCallId = "3"; | 131 | $apiCallId = "3"; |
| 132 | $pdfId = new pdfModel(); | 132 | $pdfId = new pdfModel(); |
| 133 | $pdfId = $pdfId->changePdf($apiCallId, $json); | 133 | $pdfId = $pdfId->changePdf($apiCallId, $json); |
| 134 | header("Access-Control-Allow-Origin: *"); | 134 | |
| 135 | |||
| 136 | // ALLOW OPTIONS METHOD | ||
| 137 | $headers = [ | ||
| 138 | |||
| 139 | 'Access-Control-Allow-Methods'=> 'POST, GET, OPTIONS, PUT, DELETE', | ||
| 140 | 'Access-Control-Allow-Headers'=> 'Content-Type, X-Auth-Token, Origin' | ||
| 141 | ]; | ||
| 142 | $pdf = new PdfController(); | 135 | $pdf = new PdfController(); |
| 143 | $pdf = $pdf->pdf($pdfId); | 136 | $pdf = $pdf->pdf($pdfId); |
| 144 | $response = $pdf; | 137 | $response = $pdf; |
| 145 | $statusCode = 200; | 138 | $statusCode = 200; |
| 146 | return Response::json($response, $statusCode, $headers); | 139 | return Response::json($response, $statusCode); |
| 147 | 140 | ||
| 148 | 141 | ||
| 149 | 142 | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | // allow origin | ||
| 4 | header('Access-Control-Allow-Origin: *'); | ||
| 5 | // add any additional headers you need to support here | ||
| 6 | header('Access-Control-Allow-Headers: Origin, Content-Type'); | ||
| 7 | |||
| 8 | |||
| 3 | /* | 9 | /* |
| 4 | |-------------------------------------------------------------------------- | 10 | |-------------------------------------------------------------------------- |
| 5 | | Create The Application | 11 | | Create The Application | ... | ... |
-
Please register or sign in to post a comment