@param Repository $repository

@return string
967981
public static function getCachePathByRepository(Repository $repository)
    {
        $path = path('cache') . 'framework/pckg_database_repository_' . str_replace(
                ['\\', '/'],
                '_',
                (get_class(app()) . '_' . get_class(env()))
            ) . '_' . $repository->getName() . '_' . ($repository->getConnection()->uniqueName ?? '') . '.cache';

        return $path;
    }
190661
protected function buildAsDeep(Repository $repository)
    {
        $build = [];

        if (! $this->checkPermission($this, $repository)) {
            return;
        }

        foreach ($this->layouts as $key => $layouts) {
            $layouts = Arr::wrap($layouts);

            $build += $this->buildChild($layouts, $key, $repository);
        }

        $variables = array_merge($this->variables, [
            'manyForms'           => $build,
            'templateSlug'        => $this->getSlug(),
            'templateAsync'       => $this->asyncNext,
            'templateAsyncMethod' => $this->asyncMethod,
        ]);

        return view($this->async ? 'platform::container.layouts.blank' : $this->template, $variables);
    }
945900
public function getTags($repository)
    {
        /* @var $response Response */
        $response = $this->client->get('repos/'.$repository.'/tags')->send();

        return json_decode($response->getBody(true), true);
    }
1004929
protected function ensureRepository( $repository ) {
    if ( $repository === null ) {
      return new Repository();
    }

    if ( $repository instanceof RepostoryContract ) {
      return $repository;
    }

    if ( is_array( $repository ) ) {
      return new Repository( $repository );
    }

    throw new \LogicException( 'A repository should either be an array or a Flysystem\Repository object.' );
  }
1136709
public function check($username, $repository, $assignee)
    {
        return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/assignees/'.rawurlencode($assignee));
    }
172881
public function handle(MenuRepositoryInterface $repository)
    {
        $this->setLocale();

        $repository->ignorePermission()->initialize();

        $groups = $repository->getMenuLayout();

        if (count($groups)) {

            $this->comment('Menu layout:');
            $this->info('');

            foreach ($groups as $group) {

                $this->displaySingle($group, 1);
            }
        }
    }
869246
protected function getSlugsToReset(Repository $repository)
    {
        if ($this->validSlugProvided($repository)) {
            return collect([$this->argument('slug')]);
        }

        if ($this->option('force')) {
            return $repository->all()->pluck('slug');
        }

        return $repository->enabled()->pluck('slug');
    }
357431
public function getEloquentRepository()
    {
        $repositoryGenerator = new RepositoryEloquentGenerator([
            'name' => $this->name,
        ]);

        $repository = $repositoryGenerator->getRootNamespace() . '\\' . $repositoryGenerator->getName();

        return str_replace([
            "\\",
            '/'
        ], '\\', $repository) . 'RepositoryEloquent';
    }
1262119
public function createGitattributesBadge($repository, $format = 'svg')
    {
        $repo = str_replace('.git', '', $this->packageRepository
            ->fetchByRepository($repository)
            ->getOriginalObject()
            ->getRepository()
        );

        $request = $this->client->head(
            $repo . '/blob/master/.gitattributes',
            array(),
            array(
                'timeout'         => 2,
                'connect_timeout' => 1,
                'exceptions'      => false,
            )
        );

        $response = $this->client->send($request);
        $status = 500;
        if ($request) {
            $status = $response->getStatusCode();
        }

        $this->text = self::GITATTRIBUTES_ERROR;
        $color      = self::COLOR_ERROR;
        $subject    = self::SUBJECT_ERROR;
        if (200 === $status) {
            $this->text = self::GITATTRIBUTES_COMMITTED;
            $color      = self::COLOR_COMMITTED;
            $subject    = self::SUBJECT;
        } elseif (404 === $status) {
            $this->text = self::GITATTRIBUTES_UNCOMMITTED;
            $color      = self::COLOR_UNCOMMITTED;
            $subject    = self::SUBJECT;
        }

        return $this->createBadgeFromRepository(
            $repository,
            $subject,
            $color,
            $format
        );
    }
473522
public function addRepository(RepositoryInterface $repository)
    {
        if ($repository instanceof IssueRepository) {
            $type = 'issue';
        } else {
            throw new \Exception('Unknown repository type.');
        }

        $this->repositories[$type] = $repository;
    }
731449
public function update(Entity $entity = null, Repository $repository = null)
    {
        $entity = $this->prepareEntityIfEmpty($entity);
        $repository = $entity->getRepositoryIfEmpty($repository);

        $this->trigger(['saving', 'updating']);

        $update = $repository->update($this, $entity);

        $this->trigger(['updated', 'saved']);

        $this->setOriginalFromData();

        return $update;
    }
330965
public function exportIndex(
        Repository $repository,
        string $format
    ): string {
        $allItems = [];
        $iteration = 0;
        while (true) {
            $items = $repository
                ->query(Query::create('', $iteration, 10000))
                ->getItems();

            if (empty($items)) {
                break;
            }

            $allItems = array_merge(
                $allItems,
                $items
            );

            ++$iteration;
        }

        return $this
            ->exporterCollection
            ->getExporterByName($format)
            ->itemsToFormat($allItems);
    }
928741
public function getStableBadge(Repo $repo)
    {
        if ($repo->getPackagistSlug()) {
            return sprintf('<img src="%s" />', $this->helper->getStableVersionBadgeUrl($repo->getPackagistSlug()));
        }

        return '';
    }
1071747
public function getEntities($repository = null)
    {
        return $repository ? $this->_entities->getRepositoryEntities($repository) : $this->_entities;
    }
387043
public function fetchRepository(Repository $repository, $withBuild = true)
    {
        $response = $this->getResponse(
            sprintf('/repos/%s',$repository->getSlug()),
            array()
        );
        // Hydrate response into repository
        $project = $this->hydrate($repository, $response);

        if (!$withBuild) {
            return $project;
        }
        // Load Repository builds
        return $this->fetchBuilds($repository);
    }
174606
public function clones($owner, $repository, $per = 'day')
    {
        return $this->get('/repos/'.rawurlencode($owner).'/'.rawurlencode($repository).'/traffic/clones?per='.rawurlencode($per));
    }
803647
public function forceDelete(Entity $entity = null, Repository $repository = null)
    {
        $entity = $this->getEntityIfEmpty($entity);
        $repository = $entity->getRepositoryIfEmpty($repository);

        $this->trigger(['saving', 'deleting']);

        $delete = $repository->delete($this, $entity);

        $this->trigger(['deleted', 'saved']);

        return $delete;
    }