Closed enarltd closed 2 months ago
The documentation states that add ->data() to get the data. Your have to be like
foreach ($cData->data() as $value) {
dd($value); //looks like this does not run at all.
}
Or
$cData = Contribution::all()->data();
I get this error when I do that...
See screenshot below:
Do you want to count the data or display it?
If you want to do both, here an example:
$cData = Contribution::all();
$count = $cData->count();
$data = $cData->data();
I want to display it. There is no "count()" in my code. I want to get the documents and display them in my blade view. The "->data()" works when I query using the "first()" or "find()" but when I am getting all(), it gives me that count() error.
When I do this: $cData = Contribution::all(); $contributionData = $cData->data();
I still get the "count()" error on the 2nd line.
Maybe I am ignorantly doing something wrong somewhere
I'm sure, look through your code
Maybe I am ignorantly doing something wrong somewhere
I'm sure, look through your code
Maybe I am ignorantly doing something wrong somewhere
Could you help with parts of the code I should check because I don't know where I am starting from though
When I do dd($cData); I get the screeenshot below:
I can see the documents all under the "-queryRaw" array...
But when I do dd($cData->data()); I get the error again.
The error has been resolved. Please update to the latest version (2.0.1)
I'm sure, look through your code
Maybe I am ignorantly doing something wrong somewhere
Could you help with parts of the code I should check because I don't know where I am starting from though
The error was related to the package, not your code. Sorry about that. Please update to the latest version (2.0.1)
Thank you Sir I'll revert soon
Thank you Sir I'll revert soon
You're welcome! Please let me know after you have checked, so I can close the issue
Thank you Sir I'll revert soon
You're welcome! Please let me know after you have checked, so I can close the issue
Working perfectly Sir. Thank you!
Describe the bug A clear and concise description of what the bug is. I am trying to get all the documents from a Firestore collection. I am able to get the data and when I dd($results), I see the array of objects returned. But when I try to loop through the data or retrieve them to show in my blade view, I get nothing.
To Reproduce Steps to reproduce the behavior: $cData = Contribution::all(); dd($cData); //this give me the data from the collection
But I don't get anythig when I try this: foreach ($cData as $value) { dd(value); //looks like this does not run at all. }
Expected behavior The loop should run