In some situations, you may find it beneficial to return a custom collection class for your various Eloquent queries. No problem: overriding the
newCollection method on your model makes this task a cinch to complete.
Published on Aug 10th, 2018.
Understand.io is used by hundreds of Laravel developers to find and fix errors.
Sign up for a free 14-day trial now.