Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+ add scopes #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

braceyourself
Copy link

No description provided.


public function scopeFilterIn($query, $filters, $boolean = 'or')
{
return $this->filter($filters, $boolean);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@braceyourself Should it be return $query instead of return $this?

$query->where(function ($sub_query) use ($filter, $values) {
$sub_query->orWhereIn($filter, $values);
$query->where(function ($sub_query) use ($filter, $values, $boolean, $not) {
$sub_query->whereIn($filter, $values, $boolean, $not);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@braceyourself I think this was orWhereIn for a reason. I just don't remember it right now. Are the query pieces still self contained? i.e. (status = 'active') AND (client = 1) AND (something = 'else') ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants