Welcome Guest, Not a member yet? Register   Sign In
Question new form validation rule
#5

(This post was last modified: 10-22-2018, 06:29 AM by visualsol.)

Glenn,
Looking at this package, it seems like while it is labelled Laravel, it is almost framework agnostic, that is you should be able to make an agnostic variation of it and use it in Codeigniter 4 with only minor adjustment.  For example, once you removed the Laravel references, if you were using the CI4 Starter I recently built, you could put the call in the Secure Controller.

Steps:
1) composer require valorin/pwned-validator (replace this with your version of it)
2) use the Valorin\Pwned\Pwned Validation Rule Object
a) in controller Secure.php add after line 3: use \Valorin\Pwned\Pwned
b) at line 48 add the call:
$pwnedvalidtn = new \Valorin\Pwned\Pwned(100);
$valid = $pwnedvalidtn->validate('password', $password);
if (!valid)  {return error message}

Or you could make use of the good ole fashion validation rules in a similar manner.

Bob

PS I found  this https://gitlab.com/ExeQue/PHP-HIBP generic package just after I wrote this.
Reply


Messages In This Thread
Question new form validation rule - by glennm - 10-22-2018, 12:42 AM
RE: Question new form validation rule - by glennm - 10-22-2018, 01:31 AM
RE: Question new form validation rule - by visualsol - 10-22-2018, 06:23 AM
RE: Question new form validation rule - by glennm - 10-22-2018, 12:42 PM
RE: Question new form validation rule - by glennm - 10-22-2018, 02:00 PM
RE: Question new form validation rule - by glennm - 10-23-2018, 11:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB