File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 22
33namespace Yajra \DataTables \Services ;
44
5+ use Barryvdh \Snappy \PdfWrapper ;
56use Closure ;
67use Generator ;
78use Illuminate \Contracts \Support \Renderable ;
@@ -621,9 +622,14 @@ public function pdf()
621622 * PDF version of the table using print preview blade template.
622623 *
623624 * @return \Illuminate\Http\Response
625+ * @throws \Yajra\DataTables\Exceptions\Exception
624626 */
625627 public function snappyPdf (): Response
626628 {
629+ if (! class_exists (PdfWrapper::class)) {
630+ throw new Exception ("You need to install barryvdh/laravel-snappy to be able to use this feature. " );
631+ }
632+
627633 /** @var \Barryvdh\Snappy\PdfWrapper $snappy */
628634 $ snappy = app ('snappy.pdf.wrapper ' );
629635 $ options = (array ) config ('datatables-buttons.snappy.options ' );
You can’t perform that action at this time.
0 commit comments