How to add custom function in Pivot model Laravale?

There are three tables:
Products
id
slug
Features
id
name
Lang
id
name

Using models of Laravale and ORME made a translation of each characteristic
id feature_id lang_id content

The question how to make so that they would have any product, any characteristics that were the content in different languages?
Pivot?
Something from the category of:

id feature_product_id lang_id content

There is an option to do that methods of Laravale?

In advance very grateful for the answer
July 9th 19 at 12:57
1 answer
July 9th 19 at 12:59
Solution
Get the table Lang you don't need it. In the Product Model add a hasMany relationship to Features.
The Table Features add the product_id field and lang and get them through the link.

Via pivot you drove himself and pivot to make, but it's easier to do so.

Google such the decision fully. Here's an example https://laracasts.com/discuss/channels/eloquent/el...

Find more questions by tags Laravel