public function saveRoles($inputRoles)
    {
        if (!empty($inputRoles)) {
            $this->roles()->sync($inputRoles);
        } else {
            $this->roles()->detach();
        }
    }
public function saveRoles($inputRoles)
    {
        if (!empty($inputRoles)) {
            $this->roles()->sync($inputRoles);
        } else {
            $this->roles()->detach();
        }
    }
public function saveRoles ( $ inputRoles ) { if ( ! empty ( $ inputRoles ) ) { $ this -> roles ( ) -> sync ( $ inputRoles ) ; } else { $ this -> roles ( ) -> detach ( ) ; } }
Save the inputted roles.

@param mixed $inputRoles

@return void
Save the inputted roles .