Now that to get data I call method from controller, that returns data as JSON:
return response()->json([$data]);
Can I add to this response global data? And merge this $data?
For example I have global $user object that I want to give away in each HTTP response to avoid the following entry in each method:
return response()->json(["data" => $data, "user" => $user]);