This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

viral-vector
viral-vector

I have a simple question. I have a two model related via a pivot table. I would like to set default data on a few column on the pivot table, as new relations are created. I would like to this without exposing the fields to the relation manager view. I cannot set these defaults in the database it must be done application layer.

I attempted to create a pivotModel & in the boot method use "static::creating" it seems that this does not work on "October\Rain\Database\Pivot" models.

viral-vector
viral-vector

Solved. By by just setting the relation_config actions to add & remove. That displays the manager after attach I then my static::saving method populates the other columns.

Eugene Ternavsky
Eugene Ternavsky

O, boy I need to solve this problem too, but I can't understand a word of previous solution...( What is " relation_config actions to add & remove"? Where to find "static::saving method" ?

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.