I am try to use laravel-snappy for pdf generation.
step 1:
run composer require barryvdh/laravel-snappy
step 2:
add in providers Barryvdh\DomPDF\ServiceProvider::class,
and aliases 'PDF' => Barryvdh\DomPDF\Facade::class,
in app.php
step 3:
create function
public function pdfTest() {
$pdf = App::make('snappy.pdf.wrapper');
$pdf->loadHTML('<h1>Test</h1>');
return $pdf->inline();
}
then found error:
Class 'App\Http\Controllers\App' not found
How to resolve it.I appreciate all response. Thanks Ahead.
Add a backward slash before this line: \App::make('snappy.pdf.wrapper');
Or add use App;
below your namespace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With