Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if the class has been defined
<?php class_exists(string $class, bool $autoload = true): bool
<?php     private function loadModel(string $class)

    {

        if (!class_exists($class)) {

            return null;

        }
<?php         $reflectionClass = new \ReflectionClass($class);

        if (

            !$reflectionClass->isSubclassOf(\Illuminate\Database\Eloquent\Model::class) ||

            (class_exists('Jenssegers\Mongodb\Eloquent\Model') &&

                $reflectionClass->isSubclassOf('Jenssegers\Mongodb\Eloquent\Model'))

        ) {

            return null;