Creating Responses: Response Objects

Route::get('home', function () {
    return response('Hello World', 200)
                  ->header('Content-Type', 'text/plain');
});

Returning a full Response instance allows you to customize the response's HTTP status code and headers.

Creating Responses: Response Objects — Structure map

Clickable & Draggable!

Creating Responses: Response Objects — Related pages: