Download the PHP package elafries/firestore-model without Composer

On this page you can find all versions of the php package elafries/firestore-model. 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-model

FirestoreModel for laravel or lumen

Initilaization

Set up credential file

Create and download a credential for service account
https://console.firebase.google.com/u/0/project/`${PROJECT_ID}`/settings/serviceaccounts/adminsdk
Copy the credential.json of the service account to root directory eg: firebase-credential.json

Set up .env

Register service provider

Add this line to bootstrap/app.php

Creating a model

This will create a model, which will connect to the users table

Handle model fields

table

This is an optional parameter.
The name will be generated from the lowercase classname joined with underscores. eg:
ThisIsATable >> this_is_a_table
If you fill the $table variable the table name will be overriden by its value.

fillable

When you insert to the database these fields will be added and the secure fields ONLY!

hidden

When you fetch from the database, these fields will be hidden

secure

When you insert/update the database these fields will be encrypted.
When you insert to the database, it will extend the fillable parameters.

Using a model via dependency injection

Queries

List queries

Fetch all item in the database :array

Fetch items in the database with filtering :array

Fetch items in the database with multiple where filtering :array

Fetch items in the database with filtering and with all the hidden properties :array

Single result queries

Fetch the first in the database with filtering :array

Fetch the first in the database with filtering and with all the hidden properties :array

Fetch the first in the database by id :array

Fetch the first in the database by id, with all the hidden properties :array

Existence queries

Count all items in a query :int

Check if there is at least one result (exists) :bool

Insert :array

Update

Update by id :void

Update all which match the query :void

Delete

Delete all which match the query :void


All versions of firestore-model with dependencies

PHP Build Version
Package Version
Requires google/cloud-firestore Version ^1.19
kreait/laravel-firebase Version ^3.1
illuminate/hashing Version 8.*
phpunit/phpunit Version ^9.5
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 elafries/firestore-model contains the following files

Loading the files please wait ....