Skip to content

prokawsar/PasswordValidator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Build Status StyleCI Total Downloads License

PasswordValidator-Package

Currently in development

Installation

  • Run composer require prokawsar/password-validator

  • Then run php artisan vendor:publish and select Provider: prokawsar\PasswordValidator\PasswordValidatorServiceProvider package

all rules will be published in the App/Rules folder.

To use this package

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],

  ]);

Customization

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.