All Projects → luqmanrom → firebase-php

luqmanrom / firebase-php

Licence: other
Firebase Realtime Database PHP Wrapper

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to firebase-php

laravel-two-factor-authentication
A two-factor authentication package for Laravel >= 8
Stars: ✭ 37 (-9.76%)
Mutual labels:  laravel-package
laravel-spotify
Laravel-Spotify is a simple wrapper around the Spotify Web API that makes working with its endpoints a breeze!
Stars: ✭ 141 (+243.9%)
Mutual labels:  laravel-package
meituan-pub-union
🌈 美团分销联盟 PHP-SDK
Stars: ✭ 19 (-53.66%)
Mutual labels:  laravel-package
relations-widgets-for-backpack
Views/widgets for preview laravel relations in laravel backpack
Stars: ✭ 21 (-48.78%)
Mutual labels:  laravel-package
laravel-startkit
Laravel Admin Dashboard, Admin Template with Frontend Template, for scalable Laravel projects. It is to save your time when You start with new scalable Laravel projects with many features Bootstrap, cooreui, infyom admin Generator, roles and permissions, translatable models, spatie media and much more
Stars: ✭ 55 (+34.15%)
Mutual labels:  laravel-package
laravel-coming-soon
Laravel package to display Coming Soon page
Stars: ✭ 19 (-53.66%)
Mutual labels:  laravel-package
Laravel-Youtube-API
A way to add an API to your Laravel app that converts youtube video's to mp3/mp4 and returns a download/stream link and information.
Stars: ✭ 19 (-53.66%)
Mutual labels:  laravel-package
apitest
this is a tool for testing Laravel REST API
Stars: ✭ 11 (-73.17%)
Mutual labels:  laravel-package
crypton
Laravel Request & Response Encryption
Stars: ✭ 31 (-24.39%)
Mutual labels:  laravel-package
packagist-mirror-docker
🐋📦✂️📋📦 Docker image of packagist mirror
Stars: ✭ 28 (-31.71%)
Mutual labels:  packagist
laravel-cache
An improved helper for working with cache
Stars: ✭ 64 (+56.1%)
Mutual labels:  laravel-package
laravel-repositories
DEPRECATED – A neat repository Pattern implementation for Laravel.
Stars: ✭ 18 (-56.1%)
Mutual labels:  laravel-package
anonymous-web
💬 A PreactJS powered progressive web (chat) application (Not active)
Stars: ✭ 28 (-31.71%)
Mutual labels:  firebase-database
flash
An easy way for Laravel flash notifications.
Stars: ✭ 14 (-65.85%)
Mutual labels:  laravel-package
Android-ORM-Benchmarks
No description or website provided.
Stars: ✭ 25 (-39.02%)
Mutual labels:  firebase-database
jwt-auth
🔐 JSON Web Token Authentication for Laravel & Lumen
Stars: ✭ 525 (+1180.49%)
Mutual labels:  laravel-package
laravel-secureheaders
🔒 SecureHeaders wrapper for Laravel.
Stars: ✭ 52 (+26.83%)
Mutual labels:  laravel-package
zx-ip-address
Deprecated
Stars: ✭ 96 (+134.15%)
Mutual labels:  packagist
aliyun-oss-laravel
Laravel 的 Aliyun OSS 扩展, 支持 Laravel 9. Alibaba Cloud Object Storage Service For Laravel.
Stars: ✭ 91 (+121.95%)
Mutual labels:  laravel-package
firebase-chat-sample
A sample app that shows basic usage of Firebase Auth and Database in form of a very simple chat hub app
Stars: ✭ 21 (-48.78%)
Mutual labels:  firebase-database

Firebase PHP Wrapper

Packagist

This package makes the authentication and the basic CRUD operation on Firebase Database as simple as possible. For now, it supports both Guzzle 5 and Guzzle 6.

Installation

The easiest way it via Composer

composer require geckob/firebase

Usages

1. Authentication

1.1 Generate Service Account secret file

This package supported authentication using secrets file generated in the Service Account page.

To generate the secret file, follow this steps

  1. Go to Firebase Console
  2. Choose your project
  3. Click the gear icon and go to Project Settings
  4. Click the Service Accounts tab
  5. Scroll down and click "Generate New Private Key" button. Save it to somewhere secure but accessible for your internal server

1.2 Use the secret file to authenticate

    $firebase = new \Geckob\Firebase\Firebase('path_to_your_secret_file.json');

2. CRUD Operation

The CRUD operation on Firebase Database is based on the Firebase REST API Docs.

Assuming the authentication is succesfully done,

// Set the parent node. 
$firebase = $firebase->setPath('bookings/');

// Create a new node with key = test and value = testValue. 
// If the node already exist, it will update the value
$firebase->set('test','testValue');

// Support multiple nodes, if it doesnt exist, it will create the node
$firebase->set('testObject/testKey', 'testValueObject');


// Same as set but without keys. This requires to call setPath first to identify the parent
$firebase->push([
	'test'  => 'value',
	'test1' => 'value1'
]);

// Get the value of node with key = test
$firebase->get('test');

// Get the value of using multilevel key
$firebase->get('testObject/testKey');




// Delete the node with key = test
$firebase->delete('test');

// Delete the multilevel node and all it's children
$firebase->delete('testObject/testKey');

//

Others

This package works perfectly fine for my use case for now. Should you have any other use cases that requires me to extend the features, or suggestions how this package can be improved, feel free to open issues or email me at [email protected]

License

The MIT License (MIT)

Copyright (c) 2012-2016 Tamas Kalman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].