Prepare the payload for queueing.

@param  string  $id
@param  string  $payload
@return string
499432
protected function preparePayload($id, $payload)
    {
        return json_encode(array_merge(json_decode($payload, true), [
            'id' => $id,
            'attempts' => 0,
            'retry_of' => $this->id,
        ]));
    }
1136456
public function process($payload) {
        $result = $this->convertToObject($payload, true);

        return $this->processPayload($result);
    }
510136
public function fireEdit($id, $payload = [])
    {
        if (! method_exists($this, 'onEdit')) {
            return;
        }

        $payload = array_merge(['id' => $id], ['payload' => $payload]);

        $form = $this->app->call([$this, 'onEdit'], $payload);

        if ($form instanceof DisplayInterface) {
            $form->setModelClass($this->getClass());
        }

        if ($form instanceof Initializable) {
            $form->initialize();
        }

        if ($form instanceof FormInterface) {
            $form->setAction($this->getUpdateUrl($id));
            $form->setId($id);
        }

        return $form;
    }
779517
public function put($route, array $binds = [], $payload = [])
    {
        $this->setParam($route, $binds);

        return $this->createRequest('PUT', $payload);
    }
129156
public function pushRaw($payload, $queue = null, array $options = [])
    {
        $this->getConnection()->eval(
            LuaScripts::push(), 2, $this->getQueue($queue),
            $this->getQueue($queue).':notify', $payload
        );

        return json_decode($payload, true)['id'] ?? null;
    }
1248556
public function get($id = null)
    {

        // Prep the endpoint
        $endpoint = ($id) ? $this->getEndpoint() . "/" . $id : $this->getEndpoint();

        // Get the resource
        $response = $this->client->get($endpoint, $this->prepareParams());

        // Handle response
        return $this->handleResponse(json_decode($response));

    }
849171
protected function prepareArguments(/*# string */ $id, array $arguments)
    {
        $args  = isset($arguments[1]) ? (array) $arguments[1] : [];
        $scope = isset($arguments[2]) ? (string) $arguments[2] :
            $this->getScope($id);

        // scope === '@serviceId@' ?
        if (isset($this->circular[$scope])) {
            $scope .= '#' . $this->circular[$scope];
        }

        return [ $args, $scope, $scope . '::' . $id ];
    }
1237934
public function recreate($payload, $queue, $delay)
    {
        $options = ['delay' => $this->secondsUntil($delay)];

        return $this->pushRaw($payload, $queue, $options);
    }
540909
protected function addUserInformation(&$payload)
    {
        if ($this->container->bound(Guard::class)) {
            $payload['user_id'] = $this->userId();
        }

        return $this;
    }
1056888
public function putJob($queue, $id, $delay = 0, $priority = self::PRIORITY_LOW)
    {
        $delay = intval($delay);
        $keyReady = $this->getKeyReady($queue);
        $keyDelayed = $this->getKeyDelayed($queue);
        $redisJobNamespace = $this->getRedisJobNamespace();

        $result = $this->getRedis()->transaction(
            function ($tx) use ($queue, $id, $delay, $keyDelayed, $priority, $keyReady, $redisJobNamespace) {
                /** @var $tx \Predis\Client */
                $payload = self::buildPayload($queue, (($delay) ? self::STATE_DELAYED : self::STATE_READY));
                $tx->hset($redisJobNamespace, $id, $payload);

                if ($delay <= 0) {
                    if (self::PRIORITY_HIGH === $priority) {
                        $tx->lpush($keyReady, $id);
                    } else {
                        $tx->rpush($keyReady, $id);
                    }
                } else {
                    $tx->zadd($keyDelayed, $this->getTime() + $delay, $id);
                }
            }
        );

        return !in_array(false, $result);
    }
1030473
public function generate($payload, $container = 'data')
    {
        if ($payload) {
            try {
                return serialize([$container => $payload]);
            } catch (\Exception $ex) {
                throw new ResponderException('Failed To Generate Serialized Data');
            }
        }

        return '';
    }
1007477
public function encode(Payload $payload)
    {
        $token = $this->jwt->encode($payload->get());

        return new Token($token);
    }
1216820
protected function resolveJob($payload, $queue)
    {
        return new SyncJob($this->container, $payload, $this->connectionName, $queue);
    }
1048987
public function encode(Payload $payload)
    {
        $token = $this->provider->encode($payload->get());

        return new Token($token);
    }
471455
protected function prepareId($id) {
		if (! is_scalar($id)) {
			$id = json_encode($id);
			
			if (isset($id[33])) {
				$id = md5($id);
			}
		}
		
		if ($this->namespace === null) {
			return $id;
		}
		
		return $this->namespace . '_' . $id;
	}
897585
protected function serialize($payload)
    {
        // convert identifier to Doctrine object
        if (is_array($payload) || is_scalar($payload)) {
            // just use the id when no keys are given (Doctrine expects an array like [id: 1234]
            if (is_array($payload) && is_numeric(key($payload))) {
                $payload = current($payload);
            }

            $payload = $this->doctrine->getRepository($this->className)->find($payload);
        }

        // anything else is just wrong at this point
        if (!is_object($payload) || !($payload instanceof $this->className)) {
            throw new \RuntimeException(
                sprintf('Expecting object of type %s, but got %s', $this->className, var_export($payload, true))
            );
        }

        return parent::serialize($payload);
    }
1296930
function buildPayload(&$payload)
    {
        if (is_array($payload)) {
            $payload = $this->array_map_deep($payload, array($this, 'buildPayloadItemInfo'));
        } else {
            $payload = $this->makePayloadBuilder($payload);
            $this->buildPayload($payload);
        }

        return $payload;
    }