����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 3.149.238.207 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/bofirmacademy.com/app/Traits/ |
Upload File : |
<?php namespace App\Traits; trait ImageGenerateFromHTML { private function createImage($certificate){ // https://htmlcsstoimage.com/ -- get api credential from this site //User ID: d6852a71-bb55-47c6-8e58-e08acbc0d393 //API Key: 52a9f073-5945-4ab5-a4cc-d000a10e156e $base_url = url('/'); $html = <<<EOD <h2>Hello</h2> EOD; $css = <<<EOD .certificate-frame{ padding: 2px; } EOD; $google_fonts = "Roboto"; $data = array('html'=>$html, 'css'=>$css, 'google_fonts'=>$google_fonts); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://hcti.io/v1/image"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($ch, CURLOPT_POST, 1); // Retrieve your user_id and api_key from https://htmlcsstoimage.com/dashboard curl_setopt($ch, CURLOPT_USERPWD, "d6852a71-bb55-47c6-8e58-e08acbc0d393" . ":" . "52a9f073-5945-4ab5-a4cc-d000a10e156e"); $headers = array(); $headers[] = "Content-Type: application/x-www-form-urlencoded"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } curl_close ($ch); $res = json_decode($result,true); return $res['url']; } }