Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if a value exists in an array
<?php in_array(mixed $needle, array $haystack, bool $strict = false): bool
<?php public function extensionIsOneOf($filetypes = [])
{
return in_array(strtolower($this->extension()), $filetypes);
}
<?php public function guessedExtensionIsOneOf($filetypes = [])
{
return in_array(strtolower($this->guessedExtension()), $filetypes);
}
public function __toString()
<?php }
if (Str::startsWith($handle, 'is_')) {
return in_array(Str::after($handle, 'is_'), $this->roles());
}
if (Str::startsWith($handle, 'in_')) {
<?php }
if (Str::startsWith($handle, 'in_')) {
return in_array(Str::after($handle, 'in_'), $this->groups());
}
return parent::get($handle);
<?php {
$ips = array_get($this->config, 'allowed', []);
if (! in_array(request()->ip(), $ips)) {
abort(403);
}
}
<?php {
$allowed = array_get($this->config, 'allowed', []);
return in_array($password, $allowed);
}
}
<?php $blueprintFields = User::blueprint()->fields()->all()
->keyBy->handle()
->filter(function ($field, $handle) {
return in_array($handle, ['email', 'password']);
});
return collect()
<?php {
return User::blueprint()->fields()->all()
->reject(function ($field) {
return in_array($field->handle(), ['email', 'password', 'password_confirmation', 'roles', 'groups']);
})
->map(function ($field) {
return $this->getRenderableField($field, 'user.register');
<?php $app = parent::getApplication();
foreach ($app->all() as $command) {
if (! in_array(RunsInPlease::class, class_uses($command))) {
$command->setHidden(true);
}
}
<?php }
if (in_array($disk, ['local', 'public', 's3', 'assets'])) {
return;
}
<?php $scripts = Arr::get($composerJson, 'scripts.pre-update-cmd', []);
return ! in_array(Scripts::class.'::preUpdateCmd', $scripts);
}
public static function addPreUpdateCmd()
<?php {
$command = $this->laravel->make($command);
if (! in_array(RunsInPlease::class, class_uses($command))) {
$this->deferredCommands[] = $command;
return;
<?php })
->sortKeys()
->map(function ($column) use ($preferred) {
return $column->visible(in_array($column->field(), $preferred));
})
->values()
->all();
<?php })
->reject(function ($item) {
return $item->section() === 'Top Level'
&& ! in_array($item->name(), CoreNav::ALLOWED_TOP_LEVEL);
})
->each(function ($item) use (&$sections) {
$sections[$item->section()][] = $item;
<?php private function methodExistsOnThisClass($method)
{
return method_exists($this, $method) && ! in_array($method, ['select', 'except']);
}
protected function getFromData($handle)