Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Generates a storable representation of a value
serialize(mixed $value): string
    protected function serialize($value)

    {

        
$serialized serialize($value);



        return 
$this->connection instanceof PostgresConnection

            
base64_encode($serialized)
            $job CallQueuedClosure::create($job);

        }



        return 
serialize($job);

    }
    public function put($key$value$seconds)

    {

        
$this->storage[$key] = [

            
'value' => $this->serializesValues serialize($value) : $value,

            
'expiresAt' => $this->calculateExpiration($seconds),

        ];
    {

        if (! 
is_null($existing $this->get($key))) {

            return 
tap(((int) $existing) + $value, function ($incremented) use ($key) {

                
$value $this->serializesValues serialize($incremented) : $incremented;



                
$this->storage[$key]['value'] = $value;

            });
    protected function serialize($value)

    {

        
$result serialize($value);



        if (
$this->connection instanceof PostgresConnection && str_contains($result"\0")) {

            
$result base64_encode($result);
    protected function serialize($value)

    {

        return 
is_numeric($value) ? (string) $value serialize($value);

    }
        $this->ensureCacheDirectoryExists($path $this->path($key));



        
$result $this->files->put(

            
$path$this->expiration($seconds).serialize($value), true

        
);



        if (
$result !== false && $result 0) {
        if (empty($expire) || $this->currentTime() >= $expire) {

            
$file->truncate()

                ->
write($this->expiration($seconds).serialize($value))

                ->
close();



            
$this->ensurePermissionsAreCorrect($path);
    protected function serialize($value)

    {

        return 
is_numeric($value) && ! in_array($value, [INF, -INF]) && ! is_nan($value) ? $value serialize($value);

    }
        $iv random_bytes(openssl_cipher_iv_length(strtolower($this->cipher)));



        
$value \openssl_encrypt(

            
$serialize serialize($value) : $value,

            
strtolower($this->cipher), $this->key0$iv$tag

        
);
        $hasAttachments collect($this->message->getAttachments())->isNotEmpty();



        return 
$hasAttachments ? [

            
'sent' => base64_encode(serialize($this->sent)),

            
'data' => base64_encode(serialize($this->data)),

            
'hasAttachments' => true,

        ] : [
        return $hasAttachments ? [

            
'sent' => base64_encode(serialize($this->sent)),

            
'data' => base64_encode(serialize($this->data)),

            
'hasAttachments' => true,

        ] : [

            
'sent' => $this->sent,
        ]);



        
$command $this->jobShouldBeEncrypted($job) && $this->container->bound(Encrypter::class)

                    ? 
$this->container[Encrypter::class]->encrypt(serialize(clone $job))

                    : 
serialize(clone $job);



        return 
array_merge($payload, [
        $command $this->jobShouldBeEncrypted($job) && $this->container->bound(Encrypter::class)

                    ? 
$this->container[Encrypter::class]->encrypt(serialize(clone $job))

                    : 
serialize(clone $job);



        return 
array_merge($payload, [

            
'data' => array_merge($payload['data'], [
    public function prepareForSerialization()

    {

        if (
$this->action['uses'] instanceof Closure) {

            
$this->action['uses'] = serialize(

                new 
SerializableClosure($this->action['uses'])

            );

        }



        if (isset(
$this->action['missing']) && $this->action['missing'] instanceof Closure) {