PHPackages                             prologuetech/big - 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. prologuetech/big

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

prologuetech/big
================

Google BigQuery for Laravel

v1.0.1(7y ago)1687.4k↓16.7%10[1 PRs](https://github.com/prologuetech/laravel-big/pulls)MITPHPPHP ~7.0

Since Jun 28Pushed 7y ago5 watchersCompare

[ Source](https://github.com/prologuetech/laravel-big)[ Packagist](https://packagist.org/packages/prologuetech/big)[ Docs](https://github.com/prologuetech/laravel-big)[ RSS](/packages/prologuetech-big/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (6)Used By (0)

Google BigQuery for Laravel
===========================

[](#google-bigquery-for-laravel)

This package aims to wrap laravel functionality around Google's BigQuery.

Install
-------

[](#install)

Via Composer

```
$ composer require prologuetech/big
```

Setup
-----

[](#setup)

Publish our config file into your application:

```
php artisan vendor:publish --provider="Prologuetech\Big\BigServiceProvider"
```

You should have a `config/prologue-big.php` file to configure defaults.

### Laravel 5.4.x

[](#laravel-54x)

Older versions of Laravel require you to add our big service provider to your application providers array in `config/app.php`:

```
Prologuetech\Big\BigServiceProvider::class,
```

You now have access to a familiar laravel experience, enjoy!

Google Authentication
---------------------

[](#google-authentication)

The Google SDK supports Application Default Credentials (ADC) and thus this package does as well. You may leave your `auth_file` field inside of your config file `null` to use ADC. Credentials fetcher is not currently supported but may be added in the future.

For more information see the [adc docs](https://cloud.google.com/docs/authentication/production#auth-cloud-implicit-php).

How to use
----------

[](#how-to-use)

### Configuration

[](#configuration)

By default we use the following global config options with BigQuery.

```
$this->options = [
    'useLegacySql' => false,
    'useQueryCache' => false,
];
```

### Tables

[](#tables)

When creating tables in BQ we automatically flip a Eloquent model schema for you. Let's cover an example of archiving data from our events table into BQ using laravel's chunk method.

```
$datasetId = 'test';
$tableId = 'events';

// Create our BQ helper
$big = new Big();

// Create table, we will pass in a mocked model to mutate into BQ schema
// Note: create table will only make a new table if it does not exist

/** @var Google\Cloud\BigQuery\Table $table */
$table = $big->createFromModel($datasetId, $tableId, new Event());

// Let's stream our events into BQ in large chunks
// Note: notArchived() is a simple scope, use whatever scopes you have on your model
Event::notArchived()->chunk(1000, function ($events) use ($big, $table) {
    // Prepare our rows
    $rows = $big->prepareData($events);

    // Stream into BQ, you may also pass in any options with a 3rd param.
    // Note: By default we use: 'ignoreUnknownValues' => true
    $big->insert($table, $rows);

    // Get our current id's
    /** @var Illuminate\Support\Collection $events */
    $ids = $events->pluck('id')->toArray();

    // Update these event's as processed
    Event::whereIn('id', $ids)->update([
        'system_processed' => 1
    ]);
});
```

That's it! You now have a replica of your events table in BigQuery, enjoy!

### Queries

[](#queries)

Instantiating `Big` will automatically setup a Google ServiceBuilder and give us direct access to `BigQuery` through our internals via `$big->query`. However there are many helpers built into Big that make interacting with BigQuery a piece of cake (or a tasty carrot if you're into that kind of thing).

For example when running a query on BigQuery we must use the reload method in a loop to poll results. Big comes with a useful method `run` so all you need to do is this:

```
$query = 'SELECT count(id) FROM test.events';

$big = new Big();
$results = $big->run($query);
```

When using `run` we automatically poll BigQuery and return all results as a laravel collection object for you so you can enjoy your results as a refreshing cup of Laravel.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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 ~103 days

Total

5

Last Release

2832d ago

Major Versions

v0.1.2 → v1.0.02018-04-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2413c7adec9276ba598714ff968f2ff9978ed459ed36ab7925d976718d13e35?d=identicon)[Medalink](/maintainers/Medalink)

---

Top Contributors

[![Medalink](https://avatars.githubusercontent.com/u/201221?v=4)](https://github.com/Medalink "Medalink (30 commits)")[![JamesMowatt](https://avatars.githubusercontent.com/u/4620919?v=4)](https://github.com/JamesMowatt "JamesMowatt (1 commits)")[![jesselrye](https://avatars.githubusercontent.com/u/10458747?v=4)](https://github.com/jesselrye "jesselrye (1 commits)")

---

Tags

bigquerygooglegoogle-bigquerylaravellaravel-5-packagephpphplaravelgooglebigquerybigPrologue Technology

### Embed Badge

![Health badge](/badges/prologuetech-big/health.svg)

```
[![Health](https://phpackages.com/badges/prologuetech-big/health.svg)](https://phpackages.com/packages/prologuetech-big)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[glushkovds/phpclickhouse-laravel

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

2031.2M2](/packages/glushkovds-phpclickhouse-laravel)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5462.3k](/packages/io238-laravel-iso-countries)[sebastiaanluca/laravel-boolean-dates

Automatically convert Eloquent model boolean attributes to dates (and back).

40111.7k1](/packages/sebastiaanluca-laravel-boolean-dates)[ymigval/laravel-model-cache

Laravel package for caching Eloquent model queries

7642.2k3](/packages/ymigval-laravel-model-cache)

PHPackages © 2026

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