grandnasty's avatar

How does the response function become populated?

In the documentation there is an example: https://lumen.laravel.com/docs/5.2/responses

$app->get('home', function () {
    return response($content, $status)
                  ->header('Content-Type', $value);
});

I wonder, where does the $content, $status, $value come from? I supposed it had to be scoped via the "use" syntax or created within the anonymous function for it to be usable?

EDIT: The only way I can see is that the example is lacking some commenting about the variables being created within the function. I suppose the author takes it for granted that one should understand that.. however it's not perfectly intuitive to know what $content and $status is and how they are used.

0 likes
1 reply

Please or to participate in this conversation.