mwpeng / firestore-php-laravel
Laravel wrapper of morrislaptop/firestore-php
Installs: 181
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:laravel-pakcage
Requires
- illuminate/support: ^5.7
- morrislaptop/firestore-php: ^2.2
Requires (Dev)
- laravel/framework: ^5.7
This package is auto-updated.
Last update: 2025-03-21 20:58:08 UTC
README
Laravel wrapper of morrislaptop/firestore-php.
Installation
Require this package with composer.
composer require mwpeng/firestore-php-laravel
Setup
Publish package config file.
php artisan vendor:publish --provider=Mwpeng\FirestorePhpLaravel\ServiceProvider
Config Path to the Firebase JSON key file.
'firebase-credentials' => env('FIREBASE_CREDENTIALS', null),
Usage:
Check morrislaptop/firestore-php for Methods available.
1. Inject firestore to class constructor.
<?php 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"); } }
2. Using Firestore Facade.
<?php use Mwpeng\FirestorePhpLaravel\Facades\Firestore; Firestore::collection("PathToCollection");