After calling the api, I received null from response $response->json() as the response returns a pdf file directly(not url to download the pdf file). I figured I do not need to use dompdf as well to make another HTML to pdf which was already given from the response.
Based on getContents(), it returns a long list of encoded contents for the PDF so I want to download the pdf and save to my db. Any help is appreciated.
@Sinnbeck I just tested your solution. It created a path_to_file.pdf file in the public directory. I can view it in the browser via the path, so I should save the path to my db?
@Sinnbeck Actually I wanted to save the file or path in my db(airbill column) so when I view my order history page(display tracking number, order date, amount, airbill....) where I can click on airbill and it returns a PDF for me to view on browser as well to download it.
hi , i tested the solution from Sinnbeck, but the file seems to be not valid when its downloaded to the browser. File is broken, on the server the file is working correct.