Skip to content

Commit

Permalink
add console feature, now the user can generate the classes to overrid…
Browse files Browse the repository at this point in the history
…e defaults in TokensValidation using the commande artisan.
  • Loading branch information
HichemTab-tech committed Jul 24, 2023
1 parent 6fc4fcf commit 7dad3e2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,22 @@ $confirmationToken = TokensValidation::createNewConfirmationToken(
);
```

#### Single Token Per Period:
To avoid creating multiple confirmation code at the same moment (before expiration),
you can set "**singleTokenPerTime**" parameter to true when calling the **createNewConfirmationToken** function.
This parameter allows TokensValidation to create only one confirmation code per time,
and in case the user requests another code with the same purpose (same whatFor value)
the library returns the existed token only with different expiration date.

```PHP
$confirmationToken = TokensValidation::createNewConfirmationToken(
userId: $uid,
confirmationType: ConfirmationsTokenTypes::SMALL_CODE,
whatFor: "email-confirmation",
singleTokenPerTime: true
);
```


To check it :
```PHP
Expand Down

0 comments on commit 7dad3e2

Please sign in to comment.