PHP code example of alihaider / flexible-boolean
1. Go to this page and download the library: Download alihaider/flexible-boolean 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/ */
alihaider / flexible-boolean example snippets
bash
$request->validate([
'is_active' => 'bash
use AliHaider\FlexibleBoolean\FlexibleBooleanRule;
FlexibleBooleanRule::toBoolean('true'); // true
FlexibleBooleanRule::toBoolean('false'); // false
FlexibleBooleanRule::toBoolean('1'); // true
FlexibleBooleanRule::toBoolean('0'); // false
bash
POST /api/user
{
"is_active": "true"
}
bash
$request->validate([
'is_active' => '