src/Http/Controller/Admin/VersionsController.php
public function index(VersionTableBuilder $table)
    {

        /**
         * Mimic the parent controllers method.
         */
        $table
            ->setType($this->getModel())
            ->setId($this->request->route('id'));

        $versionable = $table->getVersionableInstance();

        if ($current = $versionable->getCurrentVersion()) {
            $table->setCurrent($current);
        }

        /* @var ControlPanelBuilder $controlPanel */
        $controlPanel = $this->container->make(ControlPanelBuilder::class);

        $section = $controlPanel->getControlPanelActiveSection();

        /**
         * Mimic the default table buttons handler
         * and override the href so that we edit
         * the group and not the versionable ID.
         */
        $table->setButtons(
            [
                'load'    => [
                    'href'     => $section->getHref(
                        'edit/{request.input.group}?version={entry.version}&versionable={entry.versionable_type}'
                    ),
                    'disabled' => function (VersionInterface $entry) use ($current) {

                        if ($current->getVersion() !== $entry->getVersion()) {
                            return false;
                        }

                        return true;
                    },
                ],
            ]
        );

        return $table->render();
    }
public function index(VersionTableBuilder $table)
    {

        /**
         * Mimic the parent controllers method.
         */
        $table
            ->setType($this->getModel())
            ->setId($this->request->route('id'));

        $versionable = $table->getVersionableInstance();

        if ($current = $versionable->getCurrentVersion()) {
            $table->setCurrent($current);
        }

        /* @var ControlPanelBuilder $controlPanel */
        $controlPanel = $this->container->make(ControlPanelBuilder::class);

        $section = $controlPanel->getControlPanelActiveSection();

        /**
         * Mimic the default table buttons handler
         * and override the href so that we edit
         * the group and not the versionable ID.
         */
        $table->setButtons(
            [
                'load'    => [
                    'href'     => $section->getHref(
                        'edit/{request.input.group}?version={entry.version}&versionable={entry.versionable_type}'
                    ),
                    'disabled' => function (VersionInterface $entry) use ($current) {

                        if ($current->getVersion() !== $entry->getVersion()) {
                            return false;
                        }

                        return true;
                    },
                ],
            ]
        );

        return $table->render();
    }
public function index ( VersionTableBuilder $ table ) { /**
         * Mimic the parent controllers method.
         */ $ table -> setType ( $ this -> getModel ( ) ) -> setId ( $ this -> request -> route ( 'id' ) ) ; $ versionable = $ table -> getVersionableInstance ( ) ; if ( $ current = $ versionable -> getCurrentVersion ( ) ) { $ table -> setCurrent ( $ current ) ; } /* @var ControlPanelBuilder $controlPanel */ $ controlPanel = $ this -> container -> make ( ControlPanelBuilder :: class ) ; $ section = $ controlPanel -> getControlPanelActiveSection ( ) ; /**
         * Mimic the default table buttons handler
         * and override the href so that we edit
         * the group and not the versionable ID.
         */ $ table -> setButtons ( [ 'load' => [ 'href' => $ section -> getHref ( 'edit/{request.input.group}?version={entry.version}&versionable={entry.versionable_type}' ) , 'disabled' => function ( VersionInterface $ entry ) use ( $ current ) { if ( $ current -> getVersion ( ) !== $ entry -> getVersion ( ) ) { return false ; } return true ; } , ] , ] ) ; return $ table -> render ( ) ; }
Return a list of versions for the variable group.

@param VersionTableBuilder $table
@param                     $id
@return \Symfony\Component\HttpFoundation\Response
Return a list of versions for the variable group .