wp-eloquent icon indicating copy to clipboard operation
wp-eloquent copied to clipboard

A facade root has not been set

Open Pavel-Mukha opened this issue 3 years ago • 0 comments

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 ()

Pavel-Mukha avatar Mar 16 '21 09:03 Pavel-Mukha