The artisan commands are the only place that the getBy*() and getOrphans*() methods are used within the package.
As MediaRepository is not yet configurable the only impacted users for this change would be those that replace it in the container, or those that resolve it and expect Eloquent Collections from thegetBy*() and getOrphans*() methods.
Alternatively, we could introduce an interface to bind to and a repository_class configuration option, and ship a CursorMediaRepository that returns LazyCollections from the getBy*() and getOrphans*() methods. I initially started down this path however, I can't think of a reason that the artisan commands shouldn't always use LazyCollection.
If it's decided that the latter option is better, we should take the opportunity of a major release to create a MediaCollections\MediaRepositories namespace.
Following on from #3669...
The artisan commands are the only place that the
getBy*()
andgetOrphans*()
methods are used within the package.As
MediaRepository
is not yet configurable the only impacted users for this change would be those that replace it in the container, or those that resolve it and expect Eloquent Collections from thegetBy*()
andgetOrphans*()
methods.Alternatively, we could introduce an interface to bind to and a
repository_class
configuration option, and ship aCursorMediaRepository
that returnsLazyCollections
from thegetBy*()
andgetOrphans*()
methods. I initially started down this path however, I can't think of a reason that the artisan commands shouldn't always useLazyCollection
.If it's decided that the latter option is better, we should take the opportunity of a major release to create a
MediaCollections\MediaRepositories
namespace.I'm open to feedback.