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

Exclude authors/categories from post retrieving? #607

Open
lucamago opened this issue Mar 2, 2022 · 1 comment
Open

Exclude authors/categories from post retrieving? #607

lucamago opened this issue Mar 2, 2022 · 1 comment

Comments

@lucamago
Copy link

lucamago commented Mar 2, 2022

  • Corcel Version: 6.0.0
  • Framework Name & Version: Laravel 9
  • PHP Version: 8.1

Description:

Is there a way to filter the posts retrieving by excluding some authors/categories? Right now I'm doing a filter by published and scheduled posts, in a post_date range, and I need to exclude posts by some authors and/or categories.

CorcelPost::whereIn('post_status',array('publish','scheduled')) ->where([ ['post_date', '>=', $dateReportFrom->format('Y-m-d 00:00:01')], ['post_date', '<=', $dateReportTo->format('Y-m-d 23:59:59')] ]) ->orderBy('post_date', 'DESC') ->get(['ID','post_title','post_date','guid','post_status']);

@alexmanase
Copy link

Hi!

I think you can use whereNot.

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

No branches or pull requests

2 participants