Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to solved this ? #158

Closed
sapitidur opened this issue Sep 10, 2015 · 3 comments
Closed

How to solved this ? #158

sapitidur opened this issue Sep 10, 2015 · 3 comments

Comments

@sapitidur
Copy link

Non-static method Barryvdh\DomPDF\PDF::loadView() should not be called statically, assuming $this from incompatible context

$pdf=PDF::loadView('adm-sales.pdf',array('send'=>$sendpdf))->setPaper('A4');
return $pdf->download('send order.pdf');

@bebnev
Copy link

bebnev commented Sep 10, 2015

This happens because you are namespacing the wrong PDF class.
You are namespacing Barryvdh\DomPDF\PDF and try to use this class as "Facade" which is wrong.
So there are two posiible ways to solve your problem:

  1. Setting namespace to the facade:
use Barryvdh\DomPDF\Facade as PDF;
  1. Using alias (only if you add PDF alias to the app.php in the alias section):
use PDF;

@barryvdh
Copy link
Owner

Indeed, use the Facade.

@sagar720
Copy link

sagar720 commented Feb 22, 2018

Non-static method Barryvdh\DomPDF\PDF::loadView() should not be called statically?..Help me out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants