Skip to content

feat: add support for * ( ANY ) media collection - #3286

Merged
freekmurze merged 3 commits into
spatie:mainfrom
huzaifaarain:main
Jun 22, 2023
Merged

freekmurze merged 3 commits into
spatie:mainfrom
huzaifaarain:main

Conversation

@huzaifaarain

Copy link
Copy Markdown
Contributor

There should be an option to fetch all associated media records regardless of the collection they are associated with.

We can pass the asterisk or "star" symbol (*) to function for loading all media that belongs to the caller model.

$model->getMedia('*')

There should be an option to fetch all associated media records regardless of the collection they are associated with.

We can pass the asterisk or "star" symbol (*)  to function for loading all media that belongs to the caller model.
 
`$model->getMedia('*')`
@freekmurze

Copy link
Copy Markdown
Member

Could you add tests for this and mention this in the documentation?

@huzaifaarain

Copy link
Copy Markdown
Contributor Author

Could you add tests for this and mention this in the documentation?

Sure.

@huzaifaarain

Copy link
Copy Markdown
Contributor Author

Could you add tests for this and mention this in the documentation?

Hi @freekmurze

Please review the PR, I have added the docs and the test.

@freekmurze
freekmurze merged commit bc80215 into spatie:main Jun 22, 2023
@freekmurze

Copy link
Copy Markdown
Member

Thanks!

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