Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Finds out whether a variable is a boolean
is_bool(mixed $value): bool
    public function validAuthenticationResponse($request$result)

    {

        if (
is_bool($result)) {

            return 
json_encode($result);

        }
            foreach ($groupKeys as $groupKey) {

                
$groupKey = match (true) {

                    
is_bool($groupKey) => (int) $groupKey,

                    
$groupKey instanceof \Stringable => (string) $groupKey,

                    default => 
$groupKey,

                };
    protected function getPathAndDomain($path$domain$secure null$sameSite null)

    {

        return [
$path ?: $this->path$domain ?: $this->domainis_bool($secure) ? $secure $this->secure$sameSite ?: $this->sameSite];

    }
            if ($value instanceof DateTimeInterface) {

                
$bindings[$key] = $value->format($grammar->getDateFormat());

            } elseif (
is_bool($value)) {

                
$bindings[$key] = (int) $value;

            }

        }
        $columns func_get_args();



        if (
count($columns) > 0) {

            
$this->distinct is_array($columns[0]) || is_bool($columns[0]) ? $columns[0] : $columns;

        } else {

            
$this->distinct true;

        }
        if (str_contains($column'->') && is_bool($value)) {

            
$value = new Expression($value 'true' 'false');



            if (
is_string($column)) {
    protected function compileJsonUpdateColumn($key$value)

    {

        if (
is_bool($value)) {

            
$value $value 'true' 'false';

        } elseif (
is_array($value)) {

            
$value 'cast(? as json)';
    public function prepareBindingsForUpdate(array $bindings, array $values)

    {

        
$values collect($values)->reject(function ($value$column) {

            return 
$this->isJsonSelector($column) && is_bool($value);

        })->
map(function ($value) {

            return 
is_array($value) ? json_encode($value) : $value;

        })->
all();
    public function prepareBindingForJsonContains($binding)

    {

        return 
is_bool($binding) ? json_encode($binding) : $binding;

    }
            return $value;

        }



        return 
is_bool($value)

                    ? 
"'".(int) $value."'"

                    
"'".(string) $value."'";

    }
        $options '';



        if (! 
is_bool($column->generatedAs) && ! empty($column->generatedAs)) {

            
$options sprintf(' (%s)'$column->generatedAs);

        }
    {

        
$value $this->input($key);



        return ! 
is_bool($value) && ! is_array($value) && trim((string) $value) === '';

    }
            return trim($value) === '';

        }



        if (
is_numeric($value) || is_bool($value)) {

            return 
false;

        }
            if (is_int($key)) {

                
PHPUnit::assertTrue($errors->has($value), "Session missing error: $value");

            } else {

                
PHPUnit::assertContains(is_bool($value) ? (string) $value $value$errors->get($key$format));

            }

        }
            return $line;

        }



        if (
is_bool($value)) {

            return 
$value 'true' 'false';

        }