Why can't I use empty ($example->body
), and need to use $example->body->isEmpty()
to check for empty array. What is the return type that causes it can't use empty() and need to rely on isEmpty()
?
I do know this is from Laravel Collection based on this post. But didn't really understand why behind the scene. Any enlighten is greatly appreciated (but I'll try to understand it from freshgrad POV)