andersao / andersao/l5-repository

How to use Eloquent Scopes with l5-repository

Open
#532 8 comments 1 reaction 0 assignees View on GitHub
Dominant language
PHP
Stars
4.2k
Forks
880
PR merge metrics
No merged PRs in 30d

Description

Hello,

As the title says I'm looking to learn how to do this and if it is possible? After some digging I'm starting to believe that it's not possible to do as things are setup currently. Am I just missing something or is that correct?

Overall I'd like to be able to utilize Laravel's global and local Eloquent scopes as needed when using a repository. For example if I've defined a `scopeOurs` on a model I'd like to be able to apply the `ours()` scope to the repository when needed.

It seems like this functionality is something others are looking for too - even if said in other terms. For instance #149 seems like a case that would benefit from being able to use Eloquent scopes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.