Jun 26, 2020
0
Level 1
how to convert html to image
I am making an API in laravel lumen. I want to convert blade file into image in laravel. First I am converting blade file into html and then html to image. blade to html is converting, but how to convert html to image?
I have to return path of converted image in response.
my controller is:
public function savecard()
{
$result = json_decode(json_encode($result), true);
$destinationPath = storage_path('uploads/card_html/');
$new_path = str_replace('\', '/', $destinationPath);
$html = view($selected_template,compact('result'));
$html = $html->render();
File::put($new_path.$html_save, view($selected_template,compact('result'))
->with(['CardSave' => $html, 'message' => 'Success'])
->render()
);
}
in above code $result is coming from query and it will show on blade file. But after that, how to convert html to image.
Please or to participate in this conversation.