/** * Synchronize roles in the database */ protected function synchronizeRoles() { $rolesConfig = Config::get('membership::database.roles'); $roles = array(); foreach ($rolesConfig as $type => $description) { $roles[] = new Role(compact('type', 'description')); } Role::matchRoles(new Collection($roles)); }
/** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function role() { return $this->belongsTo(Role::getClass(), 'role_id'); }
/** * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function roles() { return $this->belongsToMany(Role::getClass(), 'le_user_role', 'user_id', 'role_id'); }