PHPackages                             juanparati/laravel-bq - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. juanparati/laravel-bq

ActiveLibrary[Database &amp; ORM](/categories/database)

juanparati/laravel-bq
=====================

A modern BigQuery connection manager for Laravel

13.0(1y ago)25.4k↓60.2%2MITPHPPHP ^8.0

Since Aug 30Pushed 3w ago1 watchersCompare

[ Source](https://github.com/juanparati/laravel-bq)[ Packagist](https://packagist.org/packages/juanparati/laravel-bq)[ RSS](/packages/juanparati-laravel-bq/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (10)Versions (8)Used By (0)

BigQuery Connection Manager for Laravel
=======================================

[](#bigquery-connection-manager-for-laravel)

What is it?
-----------

[](#what-is-it)

A Laravel library that allows to manage BigQuery connections and to perform queries in an easy way.

This library is a wrapper of the original [Google BigQuery library](https://github.com/googleapis/google-cloud-php-bigquery).

Features:

- Multi-project and multi-credentials.
- Cache adapter for Laravel.
- Abstraction methods.
- Secure inline credentials.

Installation
------------

[](#installation)

```
composer require juanparati/laravel-bq

```

Facade registration (optional):

```
'aliases' => [
    ...
    'BQ' => \Juanparati\LaravelBQ\Facades\BigQueryManagerFacade::class,
    ...
]

```

Configuration
-------------

[](#configuration)

Generate configuration file:

```
artisan vendor:publish --provider="Juanparati\LaravelBQ\Providers\BigQueryManagerProvider"

```

There are two ways of provide the credentials:

1. Defining the service account configuration file as path. Example:

```
    'projects' => [
        'default' => [
            'project_id'  => env('BIGQUERY_DEFAULT_PROJECT_ID'),
            'location'    => env('BIGQUERY_DEFAULT_LOCATION', ''),
            'credentials' => '../../bigquery_service.json'  // Path to service account configuration
        ]
    ],

```

2. Providing the credentials inline. Example:

```
    'projects' => [
        'default' => [
            'project_id'  => env('BIGQUERY_DEFAULT_PROJECT_ID'),
            'location'    => env('BIGQUERY_DEFAULT_LOCATION', ''),
            'credentials' => [
                  'type': 'service_account',
                  'project_id': 'foobar',
                  'private_key_id': '123456',
                  'private_key': "-----BEGIN PRIVATE KEY-----\nFOOBAR\nFOOBAR=\n-----END PRIVATE KEY-----\n",
                  'client_email': 'bigquery@test.iam.gserviceaccount.com',
                  'client_id': '1234567890',
                  'auth_uri': 'https://accounts.google.com/o/oauth2/auth',
                  'token_uri': 'https://oauth2.googleapis.com/token',
                  'auth_provider_x509_cert_url': 'https://www.googleapis.com/oauth2/v1/certs',
                  'client_x509_cert_url': 'https://www.googleapis.com/robot/v1/metadata/x509/bigquery%40test.iam.gserviceaccount.com'
            ]
        ]
    ],

```

In order to generate secure inline credentials use the artisan command `bigquery:credentials`.

Example:

```
artisan bigquery:credentials ../bigquery_service.json --projectId=foo --location=EU

```

The previous command will generate the inline credentials with the private key encrypted using your project encryption key.

Usage
-----

[](#usage)

### Get BigQuery client for the default project

[](#get-bigquery-client-for-the-default-project)

```
BQ::getClient();

```

### Get BigQery client for another project

[](#get-bigqery-client-for-another-project)

```
BQ::project('second_project')->getClient();

```

### Run a query a return the results

[](#run-a-query-a-return-the-results)

```
$results = BQ::query('SELECT TRUE as result');

```

or for another project:

```
$results = BQ::project('second_project')->query('SELECT TRUE as result');  // Query another project

```

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance71

Regular maintenance activity

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~229 days

Recently: every ~278 days

Total

7

Last Release

25d ago

Major Versions

0.9.2 → 1.0.12022-10-28

1.0.1 → 2.02023-05-23

2.0 → 11.02024-04-05

11.0 → 12.02025-02-25

12.0 → 13.02025-02-25

PHP version history (3 changes)0.9.2PHP ^8.0.2|^8.1

2.0PHP ^8.0

13.x-devPHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/4caf72b4d969cfb8cdfbdc1d594c85b51c9316caf76b80aa0f9de7e3736cf59f?d=identicon)[juanparati](/maintainers/juanparati)

---

Top Contributors

[![juanparati](https://avatars.githubusercontent.com/u/835173?v=4)](https://github.com/juanparati "juanparati (2 commits)")

---

Tags

laravelbigquery

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/juanparati-laravel-bq/health.svg)

```
[![Health](https://phpackages.com/badges/juanparati-laravel-bq/health.svg)](https://phpackages.com/packages/juanparati-laravel-bq)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[kreait/laravel-firebase

A Laravel package for the Firebase PHP Admin SDK

1.3k18.7M49](/packages/kreait-laravel-firebase)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8465.5M96](/packages/laravel-doctrine-orm)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[firevel/firebase-authentication

Firebase authentication driver for Laravel

2225.0k3](/packages/firevel-firebase-authentication)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
