PHP 8.3.31
Preview: Json.php Size: 1.13 KB
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/Json.php

<?php

namespace Illuminate\Database\Eloquent\Casts;

class Json
{
    /**
     * The custom JSON encoder.
     *
     * @var callable|null
     */
    protected static $encoder;

    /**
     * The custom JSON decode.
     *
     * @var callable|null
     */
    protected static $decoder;

    /**
     * Encode the given value.
     */
    public static function encode(mixed $value): mixed
    {
        return isset(static::$encoder) ? (static::$encoder)($value) : json_encode($value);
    }

    /**
     * Decode the given value.
     */
    public static function decode(mixed $value, ?bool $associative = true): mixed
    {
        return isset(static::$decoder)
                ? (static::$decoder)($value, $associative)
                : json_decode($value, $associative);
    }

    /**
     * Encode all values using the given callable.
     */
    public static function encodeUsing(?callable $encoder): void
    {
        static::$encoder = $encoder;
    }

    /**
     * Decode all values using the given callable.
     */
    public static function decodeUsing(?callable $decoder): void
    {
        static::$decoder = $decoder;
    }
}

Directory Contents

Dirs: 0 × Files: 10

Name Size Perms Modified Actions
952 B lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.27 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.73 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.39 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.86 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.78 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.73 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
965 B lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.93 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.13 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).