I have RESTful service that is available by endpoints.
For example, I request api/main
and get JSON data from server.
For response I use:
return response()->json(["categories" => $categories]);
How to control format of response passing parameter in URL?
As sample I need this: api/main?format=json|html
that it will work for each response
in controllers.