capsule = new Capsule; $this->capsule->addConnection([ 'driver' => $_ENV['DB_DRIVER'], 'host' => $_ENV['DB_HOST'], 'database' => $_ENV['DB_NAME'], 'username' => $_ENV['DB_USER'], 'password' => $_ENV['DB_PASSWORD'], 'charset' => $_ENV['DB_CHARSET'], 'collation' => $_ENV['DB_COLLATION'], 'prefix' => $_ENV['DB_PREFIX'], ]); // Setup the Eloquent ORM… $this->capsule->setAsGlobal(); $this->capsule->bootEloquent(); $this->schema = $this->capsule->schema(); } public function createBuilder(string $table_name): \Illuminate\Database\Query\Builder { $builder = new \Illuminate\Database\Query\Builder($this->schema->getConnection()); $builder->from($table_name); return $builder; } }