Supported Versions: PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL json >= 1.2.0
Decodes a JSON string
json_decode( string $json, ?bool $associative = null, int $depth = 512, int $flags = 0): mixed
protected function decodePusherResponse($request, $response)
{
if (! $request->input('callback', false)) {
return json_decode($response, true);
}
return response()->json(json_decode($response, true))
{
if (! $request->input('callback', false)) {
return json_decode($response, true);
}
return response()->json(json_decode($response, true))
return json_decode($response, true);
}
return response()->json(json_decode($response, true))
->withCallback($request->callback);
}
}
return response()->json(json_decode($response, true))
->withCallback($request->callback);
}
return [
'pending_jobs' => $batch->pending_jobs - 1,
'failed_jobs' => $batch->failed_jobs,
'failed_job_ids' => json_encode(array_values(array_diff(json_decode($batch->failed_job_ids, true), [$jobId]))),
];
});
'pending_jobs' => $batch->pending_jobs - 1,
'failed_jobs' => $batch->failed_jobs,
'failed_job_ids' => json_encode(array_values(array_diff(json_decode($batch->failed_job_ids, true), [$jobId]))),
];
});
return [
'pending_jobs' => $batch->pending_jobs,
'failed_jobs' => $batch->failed_jobs + 1,
'failed_job_ids' => json_encode(array_values(array_unique(array_merge(json_decode($batch->failed_job_ids, true), [$jobId])))),
];
});
'pending_jobs' => $batch->pending_jobs,
'failed_jobs' => $batch->failed_jobs + 1,
'failed_job_ids' => json_encode(array_values(array_unique(array_merge(json_decode($batch->failed_job_ids, true), [$jobId])))),
];
});
(int) $batch->total_jobs,
(int) $batch->pending_jobs,
(int) $batch->failed_jobs,
json_decode($batch->failed_job_ids, true),
$this->unserialize($batch->options),
CarbonImmutable::createFromTimestamp($batch->created_at),
$batch->cancelled_at ? CarbonImmutable::createFromTimestamp($batch->cancelled_at) : $batch->cancelled_at,
(int) $batch->pending_jobs,
(int) $batch->failed_jobs,
json_decode($batch->failed_job_ids, true),
$this->unserialize($batch->options),
CarbonImmutable::createFromTimestamp($batch->created_at),
$batch->cancelled_at ? CarbonImmutable::createFromTimestamp($batch->cancelled_at) : $batch->cancelled_at,
if ($value instanceof JsonSerializable) {
return $value->jsonSerialize();
} elseif ($value instanceof Jsonable) {
return json_decode($value->toJson(), true);
} elseif ($value instanceof Arrayable) {
return $value->toArray();
}
return $value->jsonSerialize();
} elseif ($value instanceof Jsonable) {
return json_decode($value->toJson(), true);
} elseif ($value instanceof Arrayable) {
return $value->toArray();
}
} elseif ($items instanceof Arrayable) {
return $items->toArray();
} elseif ($items instanceof Jsonable) {
return json_decode($items->toJson(), true);
} elseif ($items instanceof JsonSerializable) {
return (array) $items->jsonSerialize();
} elseif ($items instanceof Traversable) {
return $items->toArray();
} elseif ($items instanceof Jsonable) {
return json_decode($items->toJson(), true);
} elseif ($items instanceof JsonSerializable) {
return (array) $items->jsonSerialize();
} elseif ($items instanceof Traversable) {
return;
}
$data = json_decode($attributes[$key], true);
return is_array($data) ? new ArrayObject($data) : null;
}
}
$data = json_decode($attributes[$key], true);
return is_array($data) ? new ArrayObject($data) : null;
}
return;
}
$data = json_decode($attributes[$key], true);
return is_array($data) ? new Collection($data) : null;
}
}
$data = json_decode($attributes[$key], true);
return is_array($data) ? new Collection($data) : null;
}
public function get($model, $key, $value, $attributes)
{
if (isset($attributes[$key])) {
return new ArrayObject(json_decode(Crypt::decryptString($attributes[$key]), true));
}
return null;
{
if (isset($attributes[$key])) {
return new ArrayObject(json_decode(Crypt::decryptString($attributes[$key]), true));
}
return null;
public function get($model, $key, $value, $attributes)
{
if (isset($attributes[$key])) {
return new Collection(json_decode(Crypt::decryptString($attributes[$key]), true));
}
return null;
{
if (isset($attributes[$key])) {
return new Collection(json_decode(Crypt::decryptString($attributes[$key]), true));
}
return null;
public function fromJson($value, $asObject = false)
{
return json_decode($value, ! $asObject);
}
{
return json_decode($value, ! $asObject);
}
protected function getJsonPayload($payload)
{
$payload = json_decode(base64_decode($payload), true);
{
$payload = json_decode(base64_decode($payload), true);
return $this->namespace;
}
$composer = json_decode(file_get_contents($this->basePath('composer.json')), true);
foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) {
foreach ((array) $path as $pathChoice) {
}
$composer = json_decode(file_get_contents($this->basePath('composer.json')), true);
foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) {
foreach ((array) $path as $pathChoice) {
public function data(): array
{
return json_decode(file_get_contents($this->path()), true);
}
{
return json_decode(file_get_contents($this->path()), true);
}