public static function putJson(string $filename, array $data, bool $prettyPrint = true): void
    {
        if (!Str::endsWith($filename, '.json')) {
            $filename .= '.json';
        }
        $options = JSON_UNESCAPED_SLASHES;
        if ($prettyPrint) {
            $options += JSON_PRETTY_PRINT;
        }
        $data = json_encode($data, $options);
        self::put($filename, $data);
    }
public static function putJson(string $filename, array $data, bool $prettyPrint = true): void
    {
        if (!Str::endsWith($filename, '.json')) {
            $filename .= '.json';
        }
        $options = JSON_UNESCAPED_SLASHES;
        if ($prettyPrint) {
            $options += JSON_PRETTY_PRINT;
        }
        $data = json_encode($data, $options);
        self::put($filename, $data);
    }
public static function putJson ( string $ filename , array $ data , bool $ prettyPrint = true ) : void { if ( ! Str :: endsWith ( $ filename , '.json' ) ) { $ filename .= '.json' ; } $ options = JSON_UNESCAPED_SLASHES ; if ( $ prettyPrint ) { $ options += JSON_PRETTY_PRINT ; } $ data = json_encode ( $ data , $ options ) ; self :: put ( $ filename , $ data ) ; }
Save json.

@param string $filename
@param mixed[] $data
@param bool $prettyPrint Default true.
Save json .