3
Showing
1 changed file
with
9 additions
and
3 deletions
| ... | @@ -131,13 +131,19 @@ class ApiController extends Controller | ... | @@ -131,13 +131,19 @@ 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 | 134 | ||
| 135 | // ALLOW OPTIONS METHOD | ||
| 136 | $headers = [ | ||
| 137 | 'Access-Control-Allow-Origin'=> '*', | ||
| 138 | 'Access-Control-Allow-Methods'=> 'POST, GET, OPTIONS, PUT, DELETE', | ||
| 139 | 'Access-Control-Allow-Headers'=> 'Content-Type, X-Auth-Token, Origin' | ||
| 140 | ]; | ||
| 135 | $pdf = new PdfController(); | 141 | $pdf = new PdfController(); |
| 136 | $pdf = $pdf->pdf($pdfId); | 142 | $pdf = $pdf->pdf($pdfId); |
| 137 | $response = $pdf; | 143 | $response = $pdf; |
| 138 | $statusCode = 200; | 144 | $statusCode = 200; |
| 139 | return Response::json($response, $statusCode) | 145 | return Response::json($response, $statusCode, $headers); |
| 140 | ->header("Access-Control-Allow-Origin" , "*"); | 146 | |
| 141 | 147 | ||
| 142 | 148 | ||
| 143 | } | 149 | } | ... | ... |
-
Please register or sign in to post a comment