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 count media functionality #3523

Closed
wants to merge 1 commit into from

Conversation

salamwaddah
Copy link

@salamwaddah salamwaddah commented Feb 1, 2024

I would like to add countMedia as a fluent alternative to

  • count($this->getMedia($collectionName, $filters))
  • $this->getMedia($collectionName)->count();

Here's my use case in blade

// before
@if($model->getMedia()->count() > 1)
@endif

// after
@if($model->countMedia() > 1)
@endif

A similar PR #1582 closed 5 years ago but I wish this is reconsidered

@freekmurze
Copy link
Member

Thanks, but I'm going to pass on this to keep the package simple.

@freekmurze freekmurze closed this Feb 3, 2024
@salamwaddah salamwaddah deleted the add-count-media branch February 3, 2024 12:29
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