1
$pdf = PDF::loadView('pdf_view', $data)->setPaper('a4', 'portrait');

Non static method 'loadView' should not be called statically.intelephense(1036)

John Lobo
  • 14,355
  • 2
  • 10
  • 20
Rakesh L
  • 49
  • 1
  • 4

1 Answers1

0

You probably imported the wrong class or you didn't register the facade itself!

If you added the facade in config/app.php you need to do this at the top of your controller

use PDF;

If you want to point to the specific facade class you need to do this

use Barryvdh\DomPDF\Facade as PDF;

PS: Please share your full code and package name for better understanding.

Harsh Doshi
  • 191
  • 11