ucha19871 / fb
Firebase REST API easy wrapper for Laravel
1.0.7
2017-05-31 13:51 UTC
Requires
- php: >=7.1
- illuminate/support: ^5.4
- ktamas77/firebase-php: ^2.2
Requires (Dev)
- orchestra/testbench: ~3.0
- phpunit/phpunit: ^5.0
This package is not auto-updated.
Last update: 2024-11-10 04:43:06 UTC
README
Installation
composer require ucha19871/fb
After installing composer package, add the ServiceProvider to the providers array in config/app.php
Ucha19871\FB\FBServiceProvider::class,
Add this to your aliases for shorter code:
'FB' => Ucha19871\FB\Facades\FBFacades::class,
Insert the config settings in config/services.php
like this:
'firebase' => [ 'database_url' => 'https://PROJECT.firebaseio.com', 'secret' => 'KB2xZjJgAvmPROJECT8ykNrT6f2emuuaxJTr9', ]
You can get Firebase
secret
token like so:
- click on the gear icon in you Firebase Console
- Click Project settings
- Click on the Service Account tab
- Click on the Database Secrets link in the inner left-nav
- Hover over the non-displayed secret and click Show
Usage
$data = ['key' => 'data' , 'key1' => 'data1'] FB::set('/test/',$data); FB::get('/test/',['print'=> 'pretty']); FB::push('/test/',$data); FB::update('/test/',['key1' => 'Updating data by key']); FB::delete('/test/');
For more options see firebase REST documentation