Oihana PHP System

in.php

Table of Contents

Functions

in()  : string
Generates the 'in:value1,value2,...' rule expression.

Functions

in()

Generates the 'in:value1,value2,...' rule expression.

in(string ...$values) : string

The field under this rule must be included in the given list of values.

To help build the string rule, the In (and NotIn) rules have a helper method:

use Somnambulist\Components\Validation\Factory;
use Somnambulist\Components\Validation\Rules\In;

$factory = new Factory();
$validation = $factory->validate( $data,
[
   'enabled' =>
   [
       'required',
       In::make([true, 1])
   ]
]);
Parameters
$values : string
Return values
string

        
On this page

Search results