How to do request for three and more similar tags
Have a variable film
$film
$film is object of model Film, and now we on page of this film (let's put it this way) and this film has some tags from model Tag.
They are interact throw Many-to-many relationship and interact correctly when i filter films by tags BUT
I have to do a block under film, where will be show of films which have similar tags, do not generally match, but have at least 3 similar tags with this $film .
That is, I want to create a query similar to this model:
@foreach $filmtags as $filmtag
$filmtag = $filmtag->which have >=3 similar tags with $film (pryority to filmtag which have more similar tags)
@endforeach
How can this be done. Give, please, at least a hint where to go and what to look for. I do not understand how to filter by the same properties of two objects.
Please or to participate in this conversation.