Using Laravel with() and all()
Short answer: no.
all()
is a method on a Model
, which returns a Collection
, which doesn't have a with()
method.
with()
is a method on a Model
, which returns a Builder
, which doesn't have an all()
method.
Because all()
and with()
are both Model
methods, you can't chain them together.
with()->get()
is the correct chain to use, and should give you the result you want.