PHP code example of josepostiga / docker-registry-api-explorer

1. Go to this page and download the library: Download josepostiga/docker-registry-api-explorer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

josepostiga / docker-registry-api-explorer example snippets


class RepositoriesController
{
    public function index(DockerRegistryCatalogRepository $repository)
    {
        return $repository->list();
    }
}

class TagsController
{
    public function index(string $image)
    {
        // the $image variable is a route placeholder, automatically injected by Laravel as a controller method param.
        $repository = App::makeWith(DockerRegistryTagsRepository::class, [
            'image' => $image
        ]);

        return $repository->list();
    }
}

class ManifestController
{
    public function index(string $image, string $tag)
    {
        // the $image and $tag variables are route placeholders, automatically injected by Laravel as controller method params.
        $manifest = App::makeWith(DockerRegistryManifestRepository::class, [
            'image' => $image,
            'tag' => $tag,
        ]);

        return $manifest->get();
    }
}
bash
php artisan vendor:publish --tag=config