softlogic-gt/laravel-validation-rules-gt

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

v1.0.0 2023-01-16 21:47 UTC

This package is auto-updated.

Last update: 2024-11-17 01:45:36 UTC


README

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)
}