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

fujitsuDev
fujitsuDev

Hi,

My pivot table look like this:

  • user_id
  • chapter_id
  • current (boolean)

My question: how can I get and update 'current' column value? From an component method ('onInit()' for example)? From an component template ('default.htm' for example)?

I was able to create, but that's all: $user->chapters()->attach($oneChapter, ['current' => 1]); (with help: https://code-examples.net/en/q/16269b2). I finded no doc or demo code for this case...

I don't have model for many to many relation like here (UserChapter). I used it under Laravel ; I starting with October. I comes from Laravel. Should I have make? Or can I completely do without that under October?

Thanks!

Last updated

1-1 of 1

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