From 7dad3e2bdbfd261a2303731bf8ddf7220c5f907b Mon Sep 17 00:00:00 2001 From: HichemTab Date: Mon, 24 Jul 2023 22:02:07 +0100 Subject: [PATCH] add console feature, now the user can generate the classes to override defaults in TokensValidation using the commande artisan. --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 7d9f9be..35dc1d7 100644 --- a/README.md +++ b/README.md @@ -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