PHP code example of rareloop / lumberjack-validation

1. Go to this page and download the library: Download rareloop/lumberjack-validation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rareloop / lumberjack-validation example snippets


'providers' => [
    ...

    Rareloop\Lumberjack\Validation\ValidationServiceProvider::class,

    ...
],

class ContactForm extends AbstractForm
{
    protected $rules = [
        'name' => '

use App\Forms\ContactForm;

class IndexController
{
    public function handle(ContactForm $form)
    {
        if ($form->validate($_POST)) {
            // Everything's good - do something with the input
        } else {
            $errors = $form->errors();
            $values = $form->values();
            // Re-show the form with the errors and entered values
        }
    }
}