Return user subscriptions.

@param string $class

@return \Illuminate\Database\Eloquent\Relations\BelongsToMany
333743
public function subscriptions($class = __CLASS__)
    {
        return $this->morphedByMany($class, config('follow.morph_prefix'), config('follow.followable_table'))
                    ->wherePivot('relation', '=', Follow::RELATION_SUBSCRIBE)
                    ->withPivot('followable_type', 'relation', 'created_at');
    }
905521
public function fetchRoutes($class) {
		$routes = [];

		$reader = new \Doctrine\Common\Annotations\SimpleAnnotationReader();
		$reader->addNamespace('Asgard\Http\Annotation');
		if($this->cache) {
			$reader = new \Doctrine\Common\Annotations\CachedReader(
				$reader,
				$this->cache,
				$this->debug
			);
		}

		$reflection = new \ReflectionClass($class);
		$prefix = $reader->getClassAnnotation($reflection, 'Asgard\Http\Annotation\Prefix');
		$prefix = $prefix !== null ? $prefix->value:'';

		foreach($reflection->getMethods() as $method) {
			if(!preg_match('/Action$/i', $method->getName()))
				continue;
			$routeAnnot = $reader->getMethodAnnotation($method, 'Asgard\Http\Annotation\Route');
			if($routeAnnot !== null) {
				$route = trim($prefix.'/'.$routeAnnot->value, '/');
				$routes[] = new Route(
					$route,
					$class,
					preg_replace('/Action$/i', '', $method->getName()),
					[
						'host' => $routeAnnot->host,
						'requirements' => $routeAnnot->requirements,
						'method' => $routeAnnot->method,
						'name'	=>	$routeAnnot->name
					]
				);
			}
		}

		return $routes;
	}
1020445
protected function getModelColumns($class)
    {
        $attributes = [];

        $classNamespace = $this->getModelNamespace($class);

        if ($class) {
            if (class_exists($classNamespace)) {
                $model = new \ReflectionClass($classNamespace);

                if ($model->isSubclassOf('Illuminate\Database\Eloquent\Model')) {
                    $mdl = $this->app->make($classNamespace);
                    $table = $mdl->getTable();

                    if (is_array($table)) {
                        $table = array_first($table);
                    }

                    $table = $mdl->getConnection()->getTablePrefix().$table;
                    $schema = $mdl->getConnection()->getDoctrineSchemaManager($table);

                    $database = null;
                    if (strpos($table, '.')) {
                        list($database, $table) = explode('.', $table);
                    }

                    $columns = Arr::except($schema->listTableColumns($table, $database), $mdl->getHidden());

                    foreach ($columns as $column) {
                        if ($column->getType() instanceof \Doctrine\DBAL\Types\JsonArrayType) {
                            continue;
                        }

                        $castTo = $this->getCasting($column->getType());

                        $attributes[] = ['column' => $column->getName(), 'casts' => $castTo];
                    }

                    return $attributes;
                }
            } else {
                $this->error("Your model {$class} was not found in {$this->config->get('fractal.model_namespace')}\\ \r\nIf this is the first time you get this message, try to update /config/fractal.php to make changes to model_namespace accordingly.");
                exit();
            }
        }

        // use as a default attribute
        return [
            ['column' => 'id', 'casts' => null],
        ];
    }
1132640
public function dsql($class = null)
    {
        $obj = parent::dsql($class);
        if (!$obj instanceof DB_dsql_prefixed) {
            throw $this->exception('Specified class must be descendant of DB_dsql_prefixed')
            ->addMoreInfo('class', $class);
        }
        if ($this->table_prefix) {
            $obj->prefix($this->table_prefix);
        }

        return $obj;
    }
1127928
public function getParentClasses(string $class, array $parents = [])
    {
        $strParent = get_parent_class($class);

        if ($strParent) {
            $parents[] = $strParent;

            $parents = $this->getParentClasses($strParent, $parents);
        }

        return $parents;
    }
571168
private function newInstance($class)
    {
        $entity = $class->newInstance();

        if ($entity instanceof \Doctrine\Common\Persistence\ObjectManagerAware) {
            $entity->injectObjectManager($this->em, $class);
        }

        return $entity;
    }
243697
public function getSubClasses($class)
    {
        $class = $this->normalize($class);
        if ($this->classExists($class)) {
            return $this->getSubclassOfClass($class);
        } elseif ($this->interfaceExists($class)) {
            return $this->getSubclassOfInterface($class);
        } else {
            throw new ClassNotExistException($class);
        }
    }
682075
public function dsql($class = null)
    {
        $class = $class ?: $this->dsql_class;
        $obj = $this->add($class);
        if (!$obj instanceof DB_dsql) {
            throw $this->exception('Specified class must be descendant of DB_dsql')
                ->addMoreInfo('class', $class);
        }

        return $obj;
    }
147167
public function get($class) {
		if (isset($this->aliases[$class])) {
			$class = $this->aliases[$class];
		}

		if (isset($this->resolvingClasses[$class])) {
			throw new CyclicDependencyException("Cyclic dependency detected when resolving $class");
		}

		$this->resolvingClasses[$class] = true;

		if (array_key_exists($class, $this->factories)) {
			$instance = $this->getFactory($class);
		} else {
			$instance = $this->getSingleton($class);
		}

		unset($this->resolvingClasses[$class]);

		return $instance;
	}
710455
public function votes($class = __CLASS__)
    {
        return $this->morphedByMany($class, config('follow.morph_prefix'), config('follow.followable_table'))
                    ->wherePivotIn('relation', [Follow::RELATION_UPVOTE, Follow::RELATION_DOWNVOTE])
                    ->withPivot('followable_type', 'relation', 'created_at');
    }
677317
public static function getClassAndAlias($class)
    {
        if (false !== strpos($class, ' ')) {
            list($class, $alias) = explode(' ', $class);
        } else {
            $alias = null;
        }
        if (0 === strpos($class, '\\')) {
            $class = substr($class, 1);
        }

        return [$class, $alias];
    }
1320873
private function getSender($class)
    {
        $sender = in_array($class, $this->summarys) ? new SummarySender() : new BillSender();
        $sender->setClient($this->wsClient);
        if ($this->codeProvider) {
            $sender->setCodeProvider($this->codeProvider);
        }

        return $sender;
    }
130701
public function loadOne($class = '\\stdClass')
    {
        if (strtolower($class) === 'array') {
            return $this->getReader()->loadArray();
        }

        if (strtolower($class) === 'assoc') {
            return $this->getReader()->loadAssoc();
        }

        return $this->getReader()->loadObject($class);
    }
570548
public function getRepository($class)
    {
        $classMetadata = $this->getClassMetadataFor($class);
        if (!array_key_exists($class, $this->repositories)) {
            $repositoryClassName = $classMetadata->hasCustomRepository() ? $classMetadata->getRepositoryClass() : BaseRepository::class;
            $this->repositories[$class] = new $repositoryClassName($classMetadata, $this, $class);
        }

        return $this->repositories[$class];
    }
192863
public static function load($class)
    {
        $existsBefore = class_exists($class, false);
        $success = parent::load($class);
        if (!$existsBefore && class_exists($class, false)) {
            self::injectStaticDependencies($class);
        }

        return $success;
    }
1326693
public function getAncestors($class)
    {
        $ancestors = [];
        while (true) {
            $parent = $this->getParent($class);
            if ($parent) {
                $ancestors[] = $parent;
                $class = $parent;
            } else {
                break;
            }
        }
        return $ancestors;
    }
556939
public function getRelationshipEntityMetadata($class)
    {
        if (!array_key_exists($class, $this->loadedMetadata)) {
            $metadata = $this->metadataFactory->create($class);
            if (!$metadata instanceof RelationshipEntityMetadata) {
                // $class is not an relationship entity
                throw new MappingException(sprintf('The class "%s" was configured to be an RelationshipEntity but no @OGM\RelationshipEntity class annotation was found', $class));
            }
            $this->loadedMetadata[$class] = $metadata;
        }

        return $this->loadedMetadata[$class];
    }