tanthammar/laravel-rules

Custom validation rules for the Laravel Framework

3.2.0 2024-03-14 10:59 UTC

This package is auto-updated.

Last update: 2024-11-14 12:32:55 UTC


README

In this repository I will add validators and factory helpers, that I use in my SaaS app. I think especially Swedish developers will find them handy.

Requirements

  • PHP 8.1
  • Laravel v9.0

Installation

composer require tanthammar/laravel-rules

Rules, Fakers and more

See src folder

Documentation

There won't be much documentation written, this repository will grow as I add items. Hopefully the source code contains enough hints to use the components.

They are all used in the same way, following Laravel conventions.

Example:

use TantHammar\LaravelRules\Rules\PhoneNumber;
use TantHammar\LaravelRules\Rules\PersonNummer;

SomeField::make('phone')
    ->rules([ new PhoneNumber ])
SomeField::make('person_nummer')
    ->rules([ new PersonNummer ])