Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.github Update references to github organization (#1311) Sep 20, 2018
metadata Add Firestore Admin API (#1828) Apr 24, 2019
src
tests test: Update generated unit tests. (#2003) Jun 5, 2019
.gitattributes Add .gitattributes (#1074) May 31, 2018
CONTRIBUTING.md
README.md
VERSION Prepare v0.104.0 (#2038) Jun 10, 2019
composer.json Prepare v0.99.0 (#1823) Apr 16, 2019
phpunit-snippets.xml.dist Restructure apis (#943) Mar 23, 2018
phpunit-system.xml.dist
phpunit.xml.dist Restructure apis (#943) Mar 23, 2018
synth.metadata test: Update generated unit tests. (#2003) Jun 5, 2019
synth.py

README.md

Cloud Firestore for PHP

Idiomatic PHP client for Cloud Firestore.

Latest Stable Version Packagist

NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.

A NoSQL document database built for automatic scaling, high performance, and ease of application development. While the Cloud Firestore interface has many of the same features as traditional databases, as a NoSQL database it differs from them in the way it describes relationships between data objects.

Installation

To begin, install the preferred dependency manager for PHP, Composer.

Now to install just this component:

$ composer require google/cloud-firestore

Or to install the entire suite of components at once:

$ composer require google/cloud

This component requires the gRPC extension. Please see our gRPC installation guide for more information on how to configure the extension.

Authentication

Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.

Sample

require 'vendor/autoload.php';

use Google\Cloud\Firestore\FirestoreClient;

$firestore = new FirestoreClient();

$collectionReference = $firestore->collection('Users');
$documentReference = $collectionReference->document($userId);
$snapshot = $documentReference->snapshot();

echo "Hello " . $snapshot['firstName'];

Version

This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority.

Next Steps

  1. Understand the official documentation.
  2. Take a look at in-depth usage samples.
You can’t perform that action at this time.