eloquent - Can't access custom pivot element (Laravel framework) -
i created relation between user , event. added pivot element 'part_sure' pivot table , updated models appropriately:
now have problem accessing pivot element. if try this... ... doesn't display anything! no error no value.
... accessable in pivot element:
as can see, part_sure element not there.
my event model:
i don't know why isn't working. tried google hour. happy if give me hint!
you're calling events method user model, aren't showing user model.
what user model like? did event model, need specify pivot column in user model.
user model
public function events() { return $this->belongstomany('radclub\event')->withpivot('part_sure'); }
you may need edit radclub\event
proper namespace.
Comments
Post a Comment