Support the ongoing development of Laravel.io →
Database Eloquent Architecture

I am reading laravel 5.2 docs to implement many to many polymorphic relation in my Laravel Application. I have Many models like Blog, Question, Photo etc and I want to have Tagging system for all of them. I have created tags table and other as follow

-blogs
  -id (integer)
  -name (string)

-questions
  -id (integer)
  -name (string)

-photos
  -id (integer)
  -name (string)

-tags
  -id (integer)
  -name (string)

-entity_tags (pivot table)
  -id (integer)
  -tag_id (integer)
  -entity_id (integer)
  -entity_type (name)

Now my question is how I will define a Many to Many Polymorphic relation? The main problem is my pivot table is not following the laravel convention of using able as suffix in table name and column name. Unfortunately I could not find any extra parameters documentation or example of using custom pivot table name and column names.

Last updated 3 years ago.
0

Here is an exact example done in doc.

0

I have already study the document, My main problem is my table names are not according to laravel convention

0

Sign in to participate in this thread!

Eventy

Your banner here too?

sanjayojha sanjayojha Joined 15 Jan 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.