sample/Application/EncodeSamples.php
public function getDynamicSchemaExample(): array
    {
        $site = Site::instance('1', 'JSON API Samples', []);

        $encoder = Encoder::instance([
            Site::class => SiteSchema::class,
        ])->withEncodeOptions(JSON_PRETTY_PRINT);

        SiteSchema::$isShowCustomLinks = false;
        $noLinksResult                 = $encoder->encodeData($site);

        SiteSchema::$isShowCustomLinks = true;
        $withLinksResult               = $encoder->encodeData($site);

        return [
            $noLinksResult,
            $withLinksResult,
        ];
    }
public function getDynamicSchemaExample(): array
    {
        $site = Site::instance('1', 'JSON API Samples', []);

        $encoder = Encoder::instance([
            Site::class => SiteSchema::class,
        ])->withEncodeOptions(JSON_PRETTY_PRINT);

        SiteSchema::$isShowCustomLinks = false;
        $noLinksResult                 = $encoder->encodeData($site);

        SiteSchema::$isShowCustomLinks = true;
        $withLinksResult               = $encoder->encodeData($site);

        return [
            $noLinksResult,
            $withLinksResult,
        ];
    }
public function getDynamicSchemaExample ( ) : array { $ site = Site :: instance ( '1' , 'JSON API Samples' , [ ] ) ; $ encoder = Encoder :: instance ( [ Site :: class => SiteSchema :: class , ] ) -> withEncodeOptions ( JSON_PRETTY_PRINT ) ; SiteSchema :: $ isShowCustomLinks = false ; $ noLinksResult = $ encoder -> encodeData ( $ site ) ; SiteSchema :: $ isShowCustomLinks = true ; $ withLinksResult = $ encoder -> encodeData ( $ site ) ; return [ $ noLinksResult , $ withLinksResult , ] ; }
Get how schema could change dynamically.

@return array
Get how schema could change dynamically .