prokawsar/password-validator

Password validator for Laravel Framework

v1.0.0 2018-09-21 09:40 UTC

This package is auto-updated.

Last update: 2024-05-05 17:39:21 UTC


README

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.