Skip to content

Commit

Permalink
Update doc block for withCookie()
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 9, 2016
1 parent 36b067c commit 720fb86
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/Network/Response.php
Expand Up @@ -1945,8 +1945,28 @@ public function cookie($options = null)
/**
* Create a new response with a cookie set.
*
* ### Options
*
* - `name`: The Cookie name
* - `value`: Value of the cookie
* - `expire`: Time the cookie expires in
* - `path`: Path the cookie applies to
* - `domain`: Domain the cookie is for.
* - `secure`: Is the cookie https?
* - `httpOnly`: Is the cookie available in the client?
*
* ### Examples
*
* ```
* // set scalar value with defaults
* $response = $response->withCookie('remember_me', 1);
*
* // customize cookie attributes
* $response = $response->withCookie('remember_me', ['path' => '/login']);
* ```
*
* @param string $name The name of the cookie to set.
* @param array|string $data Either a string value, or an array of cookie data.
* @param array|string $data Either a string value, or an array of cookie options.
* @return static
*/
public function withCookie($name, $data = '')
Expand Down

0 comments on commit 720fb86

Please sign in to comment.