Skip to content

Commit

Permalink
user model registration fixes 4 => 5
Browse files Browse the repository at this point in the history
  • Loading branch information
phirschybar committed Aug 30, 2016
1 parent 091b14b commit e32e8e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Lifeboy/Station/Models/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ private function attach_joins($model, $user_scope, $for_user = FALSE){

} else { // new user is forced into a group

$group_id = Group::where('name', '=', $starting_group_name)->pluck('id');
$group_id = Group::where('name', '=', $starting_group_name)->first()->id;
}

$model->groups()->attach($group_id);
Expand Down
2 changes: 1 addition & 1 deletion src/Lifeboy/Station/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public function __construct()

public function groups()
{
return $this->belongsToMany('Lifeboy\Station\Models\Group');
return $this->belongsToMany('Lifeboy\Station\Models\Group', 'group_user', 'user_id', 'group_id');
}
}

0 comments on commit e32e8e5

Please sign in to comment.