Skip to content

Commit

Permalink
Add response method throwResponse()
Browse files Browse the repository at this point in the history
  • Loading branch information
vlakoff committed May 7, 2016
1 parent 594e1f5 commit 3d42fd1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Illuminate/Http/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Illuminate\Http;

use Illuminate\Http\Exception\HttpResponseException;

trait ResponseTrait
{
/**
Expand Down Expand Up @@ -81,4 +83,14 @@ public function withCookie($cookie)

return $this;
}

/**
* Throws the response in a HttpResponseException.
*
* @throws Illuminate\Http\Exception\HttpResponseException;
*/
public function throwResponse()
{
throw new HttpResponseException($this);
}
}

0 comments on commit 3d42fd1

Please sign in to comment.