PHPackages                             mustafakarali/laravel-firestore-connection - 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. mustafakarali/laravel-firestore-connection

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

mustafakarali/laravel-firestore-connection
==========================================

Google Firebase database connection to Laravel

03PHP

Since Apr 16Pushed 2y agoCompare

[ Source](https://github.com/mustafakarali/laravel-firestore-connection)[ Packagist](https://packagist.org/packages/mustafakarali/laravel-firestore-connection)[ RSS](/packages/mustafakarali-laravel-firestore-connection/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Google Firestore Database Connection to Laravel
===============================================

[](#google-firestore-database-connection-to-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b5ef3e108b106a74edf63ace4659f35f0bd4e46095685fad5f5334abe9fb1ed4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f707275766f2f6c61726176656c2d6669726573746f72652d636f6e6e656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pruvo/laravel-firestore-connection)[![Total Downloads](https://camo.githubusercontent.com/e488bda0b0db3cceb435ba11aad318a4cfd11da72289d48873fdb981fa7a0a3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f707275766f2f6c61726176656c2d6669726573746f72652d636f6e6e656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pruvo/laravel-firestore-connection)[![GitHub Actions](https://github.com/pruvo/laravel-firestore-connection/actions/workflows/main.yml/badge.svg)](https://github.com/pruvo/laravel-firestore-connection/actions/workflows/main.yml/badge.svg)

This package adds functionalities to the Eloquent model and Query builder for Google Firestore, using the original Laravel API.

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

[](#installation)

You can install the package via composer:

```
composer require pruvo/laravel-firestore-connection
```

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

[](#configuration)

You can use Firestore either as the main database, either as a side database. To do so, add a new firebase connection to config/database.php:

```
'firestore' => [
    'driver' => 'firestore',
    'database' => \Google\Cloud\Firestore\FirestoreClient::DEFAULT_DATABASE,
    'prefix' => '',

    // The project ID from the Google Developer's Console.
    'projectId' => env('GOOGLE_CLOUD_PROJECT'),

    // The full path to your service account credentials .json file
    // retrieved from the Google Developers Console.
    'keyFilePath' => env('GOOGLE_APPLICATION_CREDENTIALS'),

    // A hostname and port to emulator service.
    // 'emulatorHost'=> env('FIRESTORE_EMULATOR_HOST', 'localhost:8900'),
],
```

Eloquent
--------

[](#eloquent)

### Extending the base model

[](#extending-the-base-model)

This package includes a Firestore enabled Eloquent class that you can use to define models for corresponding collections.

```
