Skip to content

Conversation

@jimmitjoo
Copy link
Contributor

@jimmitjoo jimmitjoo commented Sep 30, 2024

I have been building this functionality in three projects now, so I think it might be something others could find usable as well.

You can check if a model has a certain tag by its name, or by its ID.

In my case I am currently developing a portal for runners where we list races of different distances, and each race can offer multiple distances. For certain distances we should display some extra options. So we put the distances as tags on the Race model. Now we need a way to check if this race has for example "Marathon", then we should display the map of aid stations, which is not the case for 5k races or shorter.

@AlexVanderbist
Copy link
Member

Nice, thanks for the PR!

@AlexVanderbist AlexVanderbist merged commit 9e7513c into spatie:main Oct 3, 2024
31 checks passed
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