PHP code example of mvaliolahi / seequest

1. Go to this page and download the library: Download mvaliolahi/seequest 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/ */

    

mvaliolahi / seequest example snippets

   
$validator = new SeeQuest('en');

$result = $validation->check($request, [
    'name' => ',
    'high_score'=> 'max:600' 
]);

$err = $validator->getErrors();
    
Request => $this->request
Attribute => $this->attribute
Value => $this->value
Rule => $this->rule
Rule-Option => $this->option



namespace Mvaliolahi\SeeQuest\Validators;


use Mvaliolahi\SeeQuest\Contracts\Validator;

class Between extends Validator
{
    public $alias = 'between';

    public function validate()
    {
        $number = explode(',', $this->option);

        if (!($this->value >= $number[0] && $this->value <= $number[1])) {
            return $this->message();
        }
    }

    public function message()
    {
        return $this->translation->of($this->alias, [
            'attribute' => $this->attribute,
            'option' => $this->option,
        ]);
    }
}

$validator = new SeeQuest('en', [ BetweenSample::class ]);