Supported Versions: PHP 8
Determine if a string contains a given substring
str_contains(string $haystack, string $needle): bool
protected function buildAbilityCallback($ability, $callback)
{
return function () use ($ability, $callback) {
if (str_contains($callback, '@')) {
[$class, $method] = Str::parseCallback($callback);
} else {
$class = $callback;
{
return function () use ($ability, $callback) {
if (str_contains($callback, '@')) {
[$class, $method] = Str::parseCallback($callback);
} else {
$class = $callback;
protected function formatAbilityToMethod($ability)
{
return str_contains($ability, '-') ? Str::camel($ability) : $ability;
}
{
return str_contains($ability, '-') ? Str::camel($ability) : $ability;
}
{
$credentials = array_filter(
$credentials,
fn ($key) => ! str_contains($key, 'password'),
ARRAY_FILTER_USE_KEY
);
$credentials = array_filter(
$credentials,
fn ($key) => ! str_contains($key, 'password'),
ARRAY_FILTER_USE_KEY
);
{
$credentials = array_filter(
$credentials,
fn ($key) => ! str_contains($key, 'password'),
ARRAY_FILTER_USE_KEY
);
$credentials = array_filter(
$credentials,
fn ($key) => ! str_contains($key, 'password'),
ARRAY_FILTER_USE_KEY
);
protected function isClassName($value)
{
return str_contains($value, '\\');
}
}
{
return str_contains($value, '\\');
}
}
protected function properString()
{
return is_string($this->recaller) && str_contains($this->recaller, '|');
}
{
return is_string($this->recaller) && str_contains($this->recaller, '|');
}
{
$result = serialize($value);
if ($this->connection instanceof PostgresConnection && str_contains($result, "\0")) {
$result = base64_encode($result);
}
$result = serialize($value);
if ($this->connection instanceof PostgresConnection && str_contains($result, "\0")) {
$result = base64_encode($result);
}
return true;
} catch (DynamoDbException $e) {
if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) {
return false;
}
} catch (DynamoDbException $e) {
if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) {
return false;
}
return (int) $response['Attributes'][$this->valueAttribute]['N'];
} catch (DynamoDbException $e) {
if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) {
return false;
}
} catch (DynamoDbException $e) {
if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) {
return false;
}
return (int) $response['Attributes'][$this->valueAttribute]['N'];
} catch (DynamoDbException $e) {
if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) {
return false;
}
} catch (DynamoDbException $e) {
if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) {
return false;
}
return $array[$key];
}
if (! str_contains($key, '.')) {
return $array[$key] ?? value($default);
}
}
if (! str_contains($key, '.')) {
return $array[$key] ?? value($default);
}
protected static function getCallReflector($callback)
{
if (is_string($callback) && str_contains($callback, '::')) {
$callback = explode('::', $callback);
} elseif (is_object($callback) && ! $callback instanceof Closure) {
$callback = [$callback, '__invoke'];
{
if (is_string($callback) && str_contains($callback, '::')) {
$callback = explode('::', $callback);
} elseif (is_object($callback) && ! $callback instanceof Closure) {
$callback = [$callback, '__invoke'];
protected static function isCallableWithAtSign($callback)
{
return is_string($callback) && str_contains($callback, '@');
}
}
{
return is_string($callback) && str_contains($callback, '@');
}
}
{
$class = $this->input->getArgument('class') ?? $this->input->getOption('class');
if (! str_contains($class, '\\')) {
$class = 'Database\\Seeders\\'.$class;
}
$class = $this->input->getArgument('class') ?? $this->input->getOption('class');
if (! str_contains($class, '\\')) {
$class = 'Database\\Seeders\\'.$class;
}
if (! str_contains($name, '.')) {
$models = $this->eagerLoadRelation($models, $name, $constraints);
}
}
$models = $this->eagerLoadRelation($models, $name, $constraints);
}
}