PHP code example of mwpeng / firestore-php-laravel

1. Go to this page and download the library: Download mwpeng/firestore-php-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mwpeng / firestore-php-laravel example snippets


'firebase-credentials' => env('FIREBASE_CREDENTIALS', null),


use Morrislaptop\Firestore\Firestore;

class ToAccessFirestore {
    /**
     * @var Firestore
     */
    private $firestore;

    /**
     * @param Firestore $firestore
     *
     * @return void
     */
    public function __construct(Firestore $firestore)
    {
        $this->firestore = $firestore;
        $this->firestore->collection("PathToCollection");
    }
    
}



use Mwpeng\FirestorePhpLaravel\Facades\Firestore;

Firestore::collection("PathToCollection");

shell
composer 
shell
php artisan vendor:publish --provider=Mwpeng\FirestorePhpLaravel\ServiceProvider