Skip to content

Commit

Permalink
Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
GraxMonzo committed Jan 18, 2021
1 parent af4a050 commit 68f0b0c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ All notable changes to `laravel-one-time-password` will be documented in this fi

## 1.0.0 - 18-01-2021

- Moving from Time-based OTP to Event-based OTP
- Moving from Time-based OTP to Event-based OTP

## 1.1.0 - 18-01-2021

- Rename method from `fieldsToSave` to `saveToFields`
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class YourEloquentModel extends Model
public function otpOptions() : OTPOptions
{
return OTPOptions::create()
->fieldsToSave('otp_secret', 'otp_counter')
->saveToFields('otp_secret', 'otp_counter')
->digitsCount(6); // optional
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/OTPOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static function create(): self
return new static();
}

public function fieldsToSave(string $secretField, string $counterField): self
public function saveToFields(string $secretField, string $counterField): self
{
$this->otpSecret = $secretField;
$this->otpCounter = $counterField;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public function setOtpOptions(OTPOptions $otpOptions): self
public function getDefaultOtpOptions(): OTPOptions
{
return OTPOptions::create()
->fieldsToSave('otp_secret', 'otp_counter');
->saveToFields('otp_secret', 'otp_counter');
}
}

0 comments on commit 68f0b0c

Please sign in to comment.