j3rrey / laravel-password-validation

discontinued take a look at https://github.com/timacdonald/rule-builder

Home Page:https://github.com/timacdonald/rule-builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Currently in development

Installation

Run composer require j3rrey/laravel-password-validation and php artisan vendor:publish

if asked choose J3rrey\PasswordValidation\PasswordValidationServiceProvider

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

How to use this package

Add use App\Rules\{RuleName}; beneath your namespace and add a rule in a Validator::make call as new RuleName

Example:

<?php
  use App\Rules\Uppercase;

  return Validator::make($data, [
      'email' => 'required|string|email|max:255|unique:users',
            
      'password' => ['required|string|min:8|confirmed', new Uppercase],

  ]);

Customization

You can set your own error messages

To change error messages go to App\Rules\{RuleName} and modify the return value in the message() function.

About

discontinued take a look at https://github.com/timacdonald/rule-builder

https://github.com/timacdonald/rule-builder


Languages

Language:PHP 100.0%