Laravel Firebase数据同步失败

Integrating Firebase in "RESTFUL API" for the first time. The data had to sync into two databases i.e. MySQL and Firebase but the data didn't sync in Firebase.

Installation of firebase sync trait composer require mpociot/laravel-firebase-sync

The configuration code to integrate Firebase into my API :-

'firebase' => [
'api_key' => 'AIzaSyCbOasfdsfdsfds',
'auth_domain' => 'restasdsaful-asdfs.firebaseapp.com',
'projectId' => 'restful-23aasdfsf60',
'messagingSenderId' => '8445794551330',
'database_url' => 'https://restful-sdfsdf23a60.firebaseio.com',
'secret' => 'mZ93YRkZ9ZErQvvtJyFKmRopsdfcwUEE5ImoMW89hWB',
'storage_bucket' => 'restfulas-23a60asda.appspot.com',
],

Note: for security reason I have changed values of configuration attributes.

Path where Firebase had been configured. config/services.php

The process that I applied for Syncronizing the Model.

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Mpociot\Firebase\SyncsWithFirebase;

class Demo extends Model
{
    use SyncsWithFirebase;

    protected $fillable = ['task','is_done'];

    protected $visible = ['id', 'task', 'is_done'];
}

Please suggest a solution if there's any error in my code or any alternatives for this kind of problem. Thanks in Advance!!.

</div>

You can do like this:

use Firebase\Firebase;

class FirebaseController extends Controller

{

public function storeTask(Request $request){
    $FIREBASE_URL = 'your_url_key;
    $FIREBASE_SECRET = 'your_firebase_secret_key';

    $fb = Firebase::initialize($FIREBASE_URL, $FIREBASE_SECRET);

    $fb = new Firebase([ 'base_url' => $FIREBASE_URL, 'token' => $FIREBASE_SECRET,]);

    $nodeSetContent = $fb->push('msg', $request->all());
    return response()->json(['data'=>$nodeSetContent]);
}

}

you can take reference from this link (https://github.com/eelkevdbos/firebase-php)