add data to collection in firebase code example
Example 1: laravel pass view with data
return view("blog", ["posts"=>$posts]);
Or:
return view("blog", compact("posts"));
Example 2: unity get data from firebase
https://firebase.google.com/docs/unity/setup
FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://YOURPROJECTNAME.firebaseio.com/");
DatabaseReference reference = FirebaseDatabase.DefaultInstance.RootReference;
FirebaseDatabase.DefaultInstance.GetReference("DATABASENAME").GetValueAsync().ContinueWith(task => {
if (task.IsFaulted)
{
}
else if (task.IsCompleted)
{
DataSnapshot snapshot = task.Result;
}
});