Download the PHP package bensontrent/firestore-php without Composer

On this page you can find all versions of the php package bensontrent/firestore-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package firestore-php

Firestore Client for PHP without gRPC

Latest Version on Packagist Total Installs Total Downloads License

Use Google Firebase without the requirement of having the gRPC extension for php installed. This is ideal for shared hosting environments. This package is totally based on Firestore REST API

Authentication / Generate API Key

1) Visit Google Cloud Firestore API
2) Select your desired project.
3) Select Credentials from left menu and select API Key from Server key or Create your own credentials

Installation

You can install the package via composer:

or install it by adding it to composer.json then run composer update

Dependencies

The bindings require the following extensions in order to work properly:

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

Usage

Initialization

Note: You likely won't need to change the 'database' => '(default)' line.

Adding a document

Make sure your Firebase Rules allow you to write to the $collection you wish to modify or you will get an error: You do not have permission to access the requested resource

NOTE: Pass third argument if you want your custom document id to set else auto-id will generate it for you. For example:

Or

And..

Special characters in the field name

If you want to use special characters in the field name, you have to use backticks.

You could use addNestedDocuments if you have multiple nested objects

This just formats the array before using the addDocument function

Inserting/Updating a document

Following will merge document (if exist) else insert the data.

NOTE: Passing 3rd argument as a boolean true will force check that document must exist and vice-versa in order to perform update operation.

For example: If you want to update document only if exist else MrShan0\PHPFirestore\Exceptions\Client\NotFound (Exception) will be thrown.

format for documentPath:

Deleting a document

List documents with pagination (or custom parameters)

Note: You can pass custom parameters as supported by firestore list document

Get field from document

Firebase Authentication

Sign in with Email and Password.

Sign in Anonymously.

Retrieve Auth Token

TODO

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please use the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of firestore-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
guzzlehttp/guzzle Version ~7.0|~6.0|~5.0|~4.0
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bensontrent/firestore-php contains the following files

Loading the files please wait ....