Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Illuminate/Cache/DatabaseLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ public function forceRelease()
/**
* Returns the owner value written into the driver for this lock.
*
* @return string
* @return string|null
*/
protected function getCurrentOwner()
{
return optional($this->connection->table($this->table)->where('key', $this->name)->first())->owner;
return $this->connection->table($this->table)->where('key', $this->name)->first()?->owner;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ public function toResponse($request)
$this->resource->jsonOptions()
), function ($response) use ($request) {
$response->original = $this->resource->resource->map(function ($item) {
return is_array($item) ? Arr::get($item, 'resource') : optional($item)->resource;
if (is_array($item)) {
return Arr::get($item, 'resource');
} elseif (is_object($item)) {
return $item->resource ?? null;
}

return null;
});

$this->resource->withResponse($request, $response);
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Routing/UrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ public function setRequest(Request $request)
$this->cachedRoot = null;
$this->cachedScheme = null;

tap(optional($this->routeGenerator)->defaultParameters ?: [], function ($defaults) {
tap($this->routeGenerator?->defaultParameters ?: [], function ($defaults) {
$this->routeGenerator = null;

if (! empty($defaults)) {
Expand Down
Loading