Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return part of a string
substr(string $string, int $offset, ?int $length = null): string
$key = $this->app['config']['app.key'];
if (str_starts_with($key, 'base64:')) {
$key = base64_decode(substr($key, 7));
}
$connection = $config['connection'] ?? null;
if (str_starts_with($key, 'base64:')) {
$key = base64_decode(substr($key, 7));
}
$connection = $config['connection'] ?? null;
try {
$expire = substr(
$contents = $this->files->get($path, true), 0, 10
);
} catch (Exception $e) {
return $this->emptyPayload();
}
$expire = substr(
$contents = $this->files->get($path, true), 0, 10
);
} catch (Exception $e) {
return $this->emptyPayload();
}
}
try {
$data = unserialize(substr($contents, 10));
} catch (Exception $e) {
$this->forget($key);
try {
$data = unserialize(substr($contents, 10));
} catch (Exception $e) {
$this->forget($key);
public static function remove($cookieValue)
{
return substr($cookieValue, 41);
}
{
return substr($cookieValue, 41);
}
if (! is_null($columns)) {
foreach ($columns as $column) {
if (($position = stripos($column, ' as ')) !== false) {
$as = substr($column, $position, 4);
[$original, $alias] = explode($as, $column);
foreach ($columns as $column) {
if (($position = stripos($column, ' as ')) !== false) {
$as = substr($column, $position, 4);
[$original, $alias] = explode($as, $column);
protected function guessModelName($name)
{
if (str_ends_with($name, 'Factory')) {
$name = substr($name, 0, -7);
}
$modelName = $this->qualifyModel(Str::after($name, $this->rootNamespace()));
{
if (str_ends_with($name, 'Factory')) {
$name = substr($name, 0, -7);
}
$modelName = $this->qualifyModel(Str::after($name, $this->rootNamespace()));
foreach ($this->eagerLoad as $name => $constraints) {
if ($this->isNestedUnder($relation, $name)) {
$nested[substr($name, strlen($relation.'.'))] = $constraints;
}
}
if ($this->isNestedUnder($relation, $name)) {
$nested[substr($name, strlen($relation.'.'))] = $constraints;
}
}
if (str_starts_with($key, 'pivot_')) {
$values[substr($key, 6)] = $value;
unset($model->$key);
}
$values[substr($key, 6)] = $value;
unset($model->$key);
}
if (\is_string($val) && str_contains($val, "\0")) {
$val = \substr($val, 0, -1);
}
return $val;
$val = \substr($val, 0, -1);
}
return $val;
public function dynamicWhere($method, $parameters)
{
$finder = substr($method, 5);
$segments = preg_split(
'/(And|Or)(?=[A-Z])/', $finder, -1, PREG_SPLIT_DELIM_CAPTURE
{
$finder = substr($method, 5);
$segments = preg_split(
'/(And|Or)(?=[A-Z])/', $finder, -1, PREG_SPLIT_DELIM_CAPTURE
{
return array_map(function ($column) {
return is_string($column) && ($aliasPosition = stripos($column, ' as ')) !== false
? substr($column, 0, $aliasPosition) : $column;
}, $columns);
}
return array_map(function ($column) {
return is_string($column) && ($aliasPosition = stripos($column, ' as ')) !== false
? substr($column, 0, $aliasPosition) : $column;
}, $columns);
}
$offset = $query instanceof JoinClause ? 3 : 6;
return '('.substr($this->compileWheres($where['query']), $offset).')';
}
return '('.substr($this->compileWheres($where['query']), $offset).')';
}
protected function compileNestedHavings($having)
{
return '('.substr($this->compileHavings($having['query']), 7).')';
}
{
return '('.substr($this->compileHavings($having['query']), 7).')';
}
return chmod($path, $mode);
}
return substr(sprintf('%o', fileperms($path)), -4);
}
}
return substr(sprintf('%o', fileperms($path)), -4);
}
$replacements = [
str_replace('/', '\\', dirname(str_replace('\\', '/', $alias))),
class_basename($alias),
substr($alias, strlen(static::$facadeNamespace)),
];
return str_replace(
str_replace('/', '\\', dirname(str_replace('\\', '/', $alias))),
class_basename($alias),
substr($alias, strlen(static::$facadeNamespace)),
];
return str_replace(