-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Eloquent ::all() returns a Collection object from an empty table #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Use
? |
Ah yes, you're right. Sorry my bad. I was a bit confused by it returning an object. |
I am new to laravel. Illuminate\Database\Eloquent\Collection Object |
…thods Make the framework more compatible with illuminate components
I might be doing something wrong here but I followed the very basic example from the docs.
I'm simple retrieving all the users from the database which is empty but I get a Collection object back with 2 protected variables so my result isn't really 'empty'.
PHP code in the Controller:
Response from
var_dump
:This means that I can't do the following in a Blade view because it will always pass the if statement:
The user model is pretty basic:
Any ideas? :-/
The text was updated successfully, but these errors were encountered: