Currently in development
-
Run
composer require prokawsar/password-validator
-
Then run
php artisan vendor:publish
and selectProvider: prokawsar\PasswordValidator\PasswordValidatorServiceProvider
package
all rules will be published in the App/Rules folder.
Use use App\Rules\{RuleName};
and add a rule in Validator::make calls as new RuleName
E.G.
<?php
use App\Rules\Uppercase;
return Validator::make($data, [
'email' => 'required|string|email|max:255|unique:users',
// 'password' => 'required|string|min:6|confirmed',
'password' => ['required', new Uppercase],
]);
You can set your own error
message
To change error message go to App\Rules\{RuleName}
and modify the return value in the message()
function.