leafsphp / form

πŸ“ Leaf form module

Home Page:https://leafphp.dev/modules/forms/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool



Leaf Form Module



Latest Stable Version Total Downloads License

Leaf's form validation functionality packaged as a serve-yourself module.

Installation

You can easily install Leaf using the Leaf CLI:

leaf install form

Or via Composer.

composer require leafs/form

Basic Usage

<?php

$data = [
  'name' => [
    'first' => 'Jane',
    'last' => 'Doe',
  ],
  'email' => 'example@example.com',
  'password' => 'password1234',
];

$validated = form()->validate($data, [
  'name' => 'array()',
  'name.first' => 'required',
  'name.last' => 'required',
  'email' => 'required|email',
  'password' => 'required|min:8'
]);

if ($validated) {
  // do something
} else {
  // get errors
  $errors = form()->errors();
}

About

πŸ“ Leaf form module

https://leafphp.dev/modules/forms/


Languages

Language:PHP 100.0%