I need to set a header with my api response.
I tried like this
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return Blog::all()->header('X-Total-Count', Blog::all()->count());
}
How to send this properly?