Skip to content

Commit

Permalink
add without cookie method
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 12, 2020
1 parent 72ea7ba commit e9483c4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Illuminate/Http/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,25 @@ public function withCookie($cookie)
return $this;
}

/**
* Expire a cookie when sending the response.
*
* @param \Symfony\Component\HttpFoundation\Cookie|mixed $cookie
* @param string|null $path
* @param string|null $domain
* @return $this
*/
public function withoutCookie($cookie, $path = null, $domain = null)
{
if (is_string($cookie) && function_exists('cookie')) {
$cookie = cookie($cookie, null, -2628000, $path, $domain);
}

$this->headers->setCookie($cookie);

return $this;
}

/**
* Get the callback of the response.
*
Expand Down

0 comments on commit e9483c4

Please sign in to comment.