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

A facade root has not been set #80

Open
Pavel-Mukha opened this issue Mar 16, 2021 · 0 comments
Open

A facade root has not been set #80

Pavel-Mukha opened this issue Mar 16, 2021 · 0 comments

Comments

@Pavel-Mukha
Copy link

When I try to get data like this
$result = DB::table('wp_users')->get();
I get an error
Fatal error: Uncaught RuntimeException: A facade root has not been set
But at the same time, if I make a request as follows
$result = User::get();
I get all records from db without error (Moreover, the User class is redefined and extended from the Model class, that is, this is not the class described in your library)
How to fix this? Because I need to use custom queries via DB::statement ()

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

1 participant