mactape/la-rules

Laravel rules for verifying the correctness of entered personal data

1.0.1 2023-08-21 13:09 UTC

This package is auto-updated.

Last update: 2024-04-21 14:27:25 UTC


README

Laravel Rules for check personal data

Installation

composer require mactape/la-rules

Usage

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use MacTape\LaRules\CorrectPhone;

class SomeFormRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'phone' => ['required', 'string', new CorrectPhone],
            'password' => 'required|string|min:6',
        ];
    }
}

Available rules:

  • CorrectPhone
  • CorrectOgrn
  • CorrectInn
  • CorrectSnils