Skip to content

Commit

Permalink
Add array support to withViewData()
Browse files Browse the repository at this point in the history
Closes #49
  • Loading branch information
reinink committed Jul 31, 2019
1 parent f2a60dc commit 1f0a6f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ public function with($key, $value = null)
return $this;
}

public function withViewData($key, $value)
public function withViewData($key, $value = null)
{
$this->viewData[$key] = $value;
if (is_array($key)) {
$this->viewData = array_merge($this->viewData, $key);
} else {
$this->viewData[$key] = $value;
}

return $this;
}
Expand Down

0 comments on commit 1f0a6f6

Please sign in to comment.