php - Why Laravel does not return an item from a collection

one text

Solution:

JSON response provides snake case results, but Laravel relations are written as camel case.

So as I mentioned in the comment you will need something like this:

var_dump($allTodos[0][0]->childrenAndSelf)

Source