Many To Many: Retrieving Intermediate Table Columns

$user = App\User::find(1);

foreach ($user->roles as $role) {
    echo $role->pivot->created_at;
}
Return $this->belongsToMany('App\Role')->withPivot('column1', 'column2');
Return $this->belongsToMany('App\Role')->withTimestamps();

Many To Many: Retrieving Intermediate Table Columns — Structure map

Clickable & Draggable!

Many To Many: Retrieving Intermediate Table Columns — Related pages: