Skip to content

softlogic-gt/laravel-validation-rules-gt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A set of useful Laravel validation rules for Guatemala (GT)

This repository contains useful Laravel validation rules for Guatemalan documents:

Installation

You can install the package via composer:

composer require softlogic-gt/laravel-validation-rules-gt

The package will automatically register itself.

Translations

If you wish to edit the package translations, you can run the following command to publish them into your resources/lang folder

php artisan vendor:publish --provider="SoftlogicGT\ValidationRulesGT\ValidationRulesGTServiceProvider"

Available rules

DPI

Determine if the field under validation is a valid Guatemalan DPI.

use SoftlogicGT\ValidationRulesGT\Rules\Dpi;

public function rules()
{
    $rules = [
        'dpi' => ['required', new Dpi()],
    ];
    $request->validate($rules)
}

NIT

Determine if the field under validation is a valid Guatemalan Tax ID (NIT).

use SoftlogicGT\ValidationRulesGT\Rules\Nit;

public function rules()
{
    $rules = [
        'nit' => ['required', new Nit()],
    ];
    $request->validate($rules)
}

About

Laravel Validation Rules Guatemala (DPI, NIT)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages