I am using laravel lumen for making an API. I need to convert blade file into html and save that file into image.
I tried, but not working.
my controller is:
public function viewcards()
{
$html = View::make('template1');
$html = $html->render();
$html = html_entity_decode($html);
return response()->json(['CardSave' => $html, 'message' => 'Success'], 201);
}
But in response of postman:
{
"CardSave": "<!DOCTYPE html>\r\n<html>\r\n <head>\r\n <title>Template One</title>\r\n <link href=\"http://localhost/ark_newtech_digbiz/digbizcardapi/public/css/style1.css\" rel=\"stylesheet\" />\r\n <link href=\"http://localhost/ark_newtech_digbiz/digbizcardapi/public/css/font-awesome.min.css\" rel=\"stylesheet\" />
}
why showing \r\n and not taking < in response. And how to save it into html?
I am stuck from 2 days. Please help anyone.