Skip to content

Commit

Permalink
tweak conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jun 1, 2017
1 parent df341e0 commit 1229b7f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Illuminate/Routing/Router.php
Expand Up @@ -619,10 +619,12 @@ protected function sortMiddleware(Collection $middlewares)
*/
public static function prepareResponse($request, $response)
{
if ($response instanceof Responsable) {
$response = $response->toResponse();
}

if ($response instanceof PsrResponseInterface) {
$response = (new HttpFoundationFactory)->createResponse($response);
} elseif ($response instanceof Responsable) {
$response = $response->toResponse();
} elseif (! $response instanceof SymfonyResponse &&
($response instanceof Arrayable ||
$response instanceof Jsonable ||
Expand Down

0 comments on commit 1229b7f

Please sign in to comment.