Closed mbkv closed 6 years ago
It's not the purpose.
You're trying to get the class of the $next
param which is the response object so it's normal that you get this back.
I didn't expect the return value for the controller to be a response object, considering I wasn't returning a response object.
Of course as I said previously, the thing I'm actually looking for is $response->original
or $response->getOriginalContent()
Whether or not this was intended, I realized that it's not a good move to change this, because it'll too much of a breaking change
want you know that response is instanceof which a object?
Description:
I wanted to have a middleware use the value returned from the controller and format it so we could have metadata alongside the actual return value. But when I tried to get the output of the controller, it returned a response object instead of the Model/Paginator/etc I returned it. I tried to find the location where it's turning it into response, but I got to
laravel/lumen-framework/src/Concerns/RoutesRequest.php
and then I just got lost between what everything was doingI know I can get the original value via $response->original. But I was wondering if returning the response was done on purpose or if it was just an oversight
Steps To Reproduce:
This returns "Illuminate\Http\Response"