Reserved Word on Eloquent Models

I have a product model and an attribute model.

Products have attributes.

The problem is that I cannot use Attributes as a member of the Product class, which extends eloquence, as eloquent it already uses. Is there any way around this?

class Product extends Model 
{
    protected $attributes;

    // ...
}
+4
source share
1 answer

You cannot rename your relationship. for example productAttributes.

, attributes Eloquent, . , - , .

0

All Articles