Many To Many Relationships
Many-to-many polymorphic relations are slightly more complicated than "morph one" and "morph many" relationships. For example, a Post model and Video model could share a polymorphic relation to a Tag model. Using a many-to-many polymorphic relation in this situation would allow your application to have a single table of unique tags that may be associated with posts or videos.
Many To Many Relationships
Simple and Easy Structure
Many-to-many relationships are defined by writing a method that returns the result of the belongsToMany.
Here are two models, and a Pivot table. with controller
#laravelbest #laravel #phpchallenge #php #laraveldeveloper #laravelwebdevelopment
Share:
0 Comments
Leave a reply