Skip to content

Commit

Permalink
Make hasMedia method signature compatible with getMedia in InteractsW…
Browse files Browse the repository at this point in the history
…ithMedia.php

The $filters arg of hasMedia does not allow the callable type, while it just calls getMedia which does allow it.
  • Loading branch information
sten authored Sep 27, 2024
1 parent 3eed807 commit 1fd6594
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/InteractsWithMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function copyMedia(string|UploadedFile $file): FileAdder
/*
* Determine if there is media in the given collection.
*/
public function hasMedia(string $collectionName = 'default', array $filters = []): bool
public function hasMedia(string $collectionName = 'default', array|callable $filters = []): bool
{
return count($this->getMedia($collectionName, $filters)) ? true : false;
}
Expand Down

0 comments on commit 1fd6594

Please sign in to comment.