Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if the class has been defined
class_exists(string $class, bool $autoload = true): bool
}
foreach ($this->guessPolicyName($class) as $guessedPolicy) {
if (class_exists($guessedPolicy)) {
return $this->resolvePolicy($guessedPolicy);
}
}
foreach ($this->guessPolicyName($class) as $guessedPolicy) {
if (class_exists($guessedPolicy)) {
return $this->resolvePolicy($guessedPolicy);
}
}
return $classDirname.'\\Policies\\'.class_basename($class).'Policy';
})->reverse()->values()->first(function ($class) {
return class_exists($class);
}) ?: [$classDirname.'\\Policies\\'.class_basename($class).'Policy']);
}
})->reverse()->values()->first(function ($class) {
return class_exists($class);
}) ?: [$classDirname.'\\Policies\\'.class_basename($class).'Policy']);
}
{
if ($channel instanceof HasBroadcastChannel) {
$channel = $channel->broadcastChannelRoute();
} elseif (is_string($channel) && class_exists($channel) && is_a($channel, HasBroadcastChannel::class, true)) {
$channel = (new $channel)->broadcastChannelRoute();
}
if ($channel instanceof HasBroadcastChannel) {
$channel = $channel->broadcastChannelRoute();
} elseif (is_string($channel) && class_exists($channel) && is_a($channel, HasBroadcastChannel::class, true)) {
$channel = (new $channel)->broadcastChannelRoute();
}
protected function serializeJob($job)
{
if ($job instanceof Closure) {
if (! class_exists(CallQueuedClosure::class)) {
throw new RuntimeException(
'To enable support for closure jobs, please install the illuminate/queue package.'
);
{
if ($job instanceof Closure) {
if (! class_exists(CallQueuedClosure::class)) {
throw new RuntimeException(
'To enable support for closure jobs, please install the illuminate/queue package.'
);
protected function resolveCommand($command)
{
if (! class_exists($command)) {
return $this->getApplication()->find($command);
}
{
if (! class_exists($command)) {
return $this->getApplication()->find($command);
}
{
$this->timezone = $timezone;
if (! class_exists(Container::class)) {
throw new RuntimeException(
'A container implementation is required to use the scheduler. Please install the illuminate/container package.'
);
$this->timezone = $timezone;
if (! class_exists(Container::class)) {
throw new RuntimeException(
'A container implementation is required to use the scheduler. Please install the illuminate/container package.'
);
public function command($command, array $parameters = [])
{
if (class_exists($command)) {
$command = Container::getInstance()->make($command);
return $this->exec(
{
if (class_exists($command)) {
$command = Container::getInstance()->make($command);
return $this->exec(
protected function dispatchToQueue($job, $queue, $connection)
{
if ($job instanceof Closure) {
if (! class_exists(CallQueuedClosure::class)) {
throw new RuntimeException(
'To enable support for closure jobs, please install the illuminate/queue package.'
);
{
if ($job instanceof Closure) {
if (! class_exists(CallQueuedClosure::class)) {
throw new RuntimeException(
'To enable support for closure jobs, please install the illuminate/queue package.'
);
}
if ($event instanceof CallbackEvent) {
if (class_exists($event->description)) {
$command = $event->description;
$description = '';
} else {
if ($event instanceof CallbackEvent) {
if (class_exists($event->description)) {
$command = $event->description;
$description = '';
} else {
{
$component = '\Illuminate\Console\View\Components\\'.ucfirst($method);
throw_unless(class_exists($component), new InvalidArgumentException(sprintf(
'Console component [%s] not found.', $method
)));
$component = '\Illuminate\Console\View\Components\\'.ucfirst($method);
throw_unless(class_exists($component), new InvalidArgumentException(sprintf(
'Console component [%s] not found.', $method
)));
public function isDoctrineAvailable()
{
return class_exists('Doctrine\DBAL\Connection');
}
{
return class_exists('Doctrine\DBAL\Connection');
}
protected function createPdoConnection($dsn, $username, $password, $options)
{
if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
return new PDOConnection($dsn, $username, $password, $options);
}
{
if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
return new PDOConnection($dsn, $username, $password, $options);
}
$modelName = $this->qualifyModel(Str::after($name, $this->rootNamespace()));
if (class_exists($modelName)) {
return $modelName;
}
if (class_exists($modelName)) {
return $modelName;
}
{
if (! empty($models = $this->option('model'))) {
return collect($models)->filter(function ($model) {
return class_exists($model);
})->values();
}
if (! empty($models = $this->option('model'))) {
return collect($models)->filter(function ($model) {
return class_exists($model);
})->values();
}
})->filter(function ($model) {
return $this->isPrunable($model);
})->filter(function ($model) {
return class_exists($model);
})->values();
}
return $this->isPrunable($model);
})->filter(function ($model) {
return class_exists($model);
})->values();
}