Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Make a string lowercase
strtolower(string $string): string
protected function isReservedName($name)
{
$name = strtolower($name);
return in_array($name, $this->reservedNames);
}
{
$name = strtolower($name);
return in_array($name, $this->reservedNames);
}
return 'decimal';
}
return trim(strtolower($this->getCasts()[$key]));
}
}
return trim(strtolower($this->getCasts()[$key]));
}
sort($segments);
return strtolower(implode('_', $segments));
}
return strtolower(implode('_', $segments));
}
}
foreach ($columns as $column => $aggregate) {
if (! in_array(strtolower($aggregate), ['min', 'max'])) {
throw new InvalidArgumentException("Invalid aggregate [{$aggregate}] used within ofMany relation. Available aggregates: MIN, MAX");
}
foreach ($columns as $column => $aggregate) {
if (! in_array(strtolower($aggregate), ['min', 'max'])) {
throw new InvalidArgumentException("Invalid aggregate [{$aggregate}] used within ofMany relation. Available aggregates: MIN, MAX");
}
protected function getTypeSwapValue($type, $value)
{
return match (strtolower($type)) {
'int', 'integer' => (int) $value,
'real', 'float', 'double' => (float) $value,
'string' => (string) $value,
{
return match (strtolower($type)) {
'int', 'integer' => (int) $value,
'real', 'float', 'double' => (float) $value,
'string' => (string) $value,
protected function invalidOperator($operator)
{
return ! is_string($operator) || (! in_array(strtolower($operator), $this->operators, true) &&
! in_array(strtolower($operator), $this->grammar->getOperators(), true));
}
{
return ! is_string($operator) || (! in_array(strtolower($operator), $this->operators, true) &&
! in_array(strtolower($operator), $this->grammar->getOperators(), true));
}
protected function invalidOperator($operator)
{
return ! is_string($operator) || (! in_array(strtolower($operator), $this->operators, true) &&
! in_array(strtolower($operator), $this->grammar->getOperators(), true));
}
{
return ! is_string($operator) || (! in_array(strtolower($operator), $this->operators, true) &&
! in_array(strtolower($operator), $this->grammar->getOperators(), true));
}
protected function isBitwiseOperator($operator)
{
return in_array(strtolower($operator), $this->bitwiseOperators, true) ||
in_array(strtolower($operator), $this->grammar->getBitwiseOperators(), true);
}
{
return in_array(strtolower($operator), $this->bitwiseOperators, true) ||
in_array(strtolower($operator), $this->grammar->getBitwiseOperators(), true);
}
protected function isBitwiseOperator($operator)
{
return in_array(strtolower($operator), $this->bitwiseOperators, true) ||
in_array(strtolower($operator), $this->grammar->getBitwiseOperators(), true);
}
{
return in_array(strtolower($operator), $this->bitwiseOperators, true) ||
in_array(strtolower($operator), $this->grammar->getBitwiseOperators(), true);
}
$bool = strtolower($connector);
$this->where(Str::snake($segment), '=', $parameters[$index], $bool);
}
$this->where(Str::snake($segment), '=', $parameters[$index], $bool);
}
$this->addBinding($bindings, $this->unions ? 'unionOrder' : 'order');
}
$direction = strtolower($direction);
if (! in_array($direction, ['asc', 'desc'], true)) {
throw new InvalidArgumentException('Order direction must be "asc" or "desc".');
}
$direction = strtolower($direction);
if (! in_array($direction, ['asc', 'desc'], true)) {
throw new InvalidArgumentException('Order direction must be "asc" or "desc".');
return $column;
}
$separator = str_contains(strtolower($column), ' as ') ? ' as ' : '\.';
return last(preg_split('~'.$separator.'~i', $column));
}
}
$separator = str_contains(strtolower($column), ' as ') ? ' as ' : '\.';
return last(preg_split('~'.$separator.'~i', $column));
}
protected function whereBasic(Builder $query, $where)
{
if (str_contains(strtolower($where['operator']), 'like')) {
return sprintf(
'%s::text %s %s',
$this->wrap($where['column']),
{
if (str_contains(strtolower($where['operator']), 'like')) {
return sprintf(
'%s::text %s %s',
$this->wrap($where['column']),
protected function createIndexName($type, array $columns)
{
$index = strtolower($this->prefix.$this->table.'_'.implode('_', $columns).'_'.$type);
return str_replace(['-', '.'], '_', $index);
}
{
$index = strtolower($this->prefix.$this->table.'_'.implode('_', $columns).'_'.$type);
return str_replace(['-', '.'], '_', $index);
}
public function hasColumn($table, $column)
{
return in_array(
strtolower($column), array_map('strtolower', $this->getColumnListing($table))
);
}
{
return in_array(
strtolower($column), array_map('strtolower', $this->getColumnListing($table))
);
}