Download the PHP package juanparati/laravel-bq without Composer
On this page you can find all versions of the php package juanparati/laravel-bq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download juanparati/laravel-bq
More information about juanparati/laravel-bq
Files in juanparati/laravel-bq
Package laravel-bq
Short Description A modern BigQuery connection manager for Laravel
License MIT
Informations about the package laravel-bq
BigQuery Connection Manager for Laravel
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.
Features:
- Multi-project and multi-credentials.
- Cache adapter for Laravel.
- Abstraction methods.
- Secure inline credentials.
Installation
composer require juanparati/laravel-bq
Facade registration (optional):
'aliases' => [
...
'BQ' => \Juanparati\LaravelBQ\Facades\BigQueryManagerFacade::class,
...
]
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:
2) Providing the credentials inline. Example:
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
Get BigQuery client for the default project
BQ::getClient();
Get BigQery client for another project
BQ::project('second_project')->getClient();
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
All versions of laravel-bq with dependencies
google/cloud-bigquery Version ^1.30
illuminate/support Version ^9.20|^10.0|^11.0|^12.0
symfony/cache Version ^6.4