Eloquent error: A facade root has not been set
You have to change your code to: $Capsule = new Capsule; $Capsule->addConnection(config::get(‘database’)); $Capsule->setAsGlobal(); //this is important $Capsule->bootEloquent(); And at the beginning of your class file you have to import: use Illuminate\Database\Capsule\Manager as DB;