From the documentations you can clear it up. https://laravel.com/docs/11.x/eloquent-relationships
Since the relations seems to be the ManyToMany, not Polymorphic one so just define the functions in models (hint: from the answers here for this question) for eloquent to get the results.