PDF ka chakkar babu bhaiya

This commit is contained in:
Manish Verma
2021-03-15 12:59:25 +05:30
parent 9c1496ad46
commit eb11b11d37
2 changed files with 13 additions and 5 deletions

View File

@@ -498,8 +498,12 @@ class TicketController extends Controller
$ticket = Tickets::where('tickets.id', '=', $id)->first();
$html = view('themes.default1.agent.helpdesk.ticket.pdf', compact('id', 'ticket', 'tickets'))->render();
$html1 = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
return PDF::load($html1)->show();
/**
* This statement throws error with php7.1
* @see https://github.com/dompdf/dompdf/issues/1272
* For time bieng we are silencing the error using "@" operator in front of it
*/
return @PDF::load($html1)->show();
}
/**
@@ -2430,8 +2434,12 @@ class TicketController extends Controller
$ticket = Tickets::where('id', $thread->ticket_id)->first();
$html = view('themes.default1.agent.helpdesk.ticket.thread-pdf', compact('thread', 'system', 'company', 'ticket'))->render();
$html1 = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
return PDF::load($html1)->show();
/**
* This statement throws error with php7.1
* @see https://github.com/dompdf/dompdf/issues/1272
* For time bieng we are silencing the error using "@" operator in front of it
*/
return @PDF::load($html1)->show();
} catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
}