I am trying to send multiple cookies with one response. I have an array with cookies named
$cookies
What would be an alternative of the following example if I have an array with values instead of specific values
return $response
->withCookie(cookie()->forever('region', $region))
->withCookie(cookie()->forever('somethingElse', $somethingElse));
I have tried the following code but it does not seem to work.
$response = $this->response(200, 'Successful');
foreach($cookies as $cookie){
$response = $response->withCookie($cookie);
}
return $response;