How would I add header to the response to this?
public function handleDonate($data, $form)
{
$donate = DonationForm::create();
$donate->FullName = $data['FullName'];
$donate->Amount = $data['Amount'];
$donate->Email = $data['Email'];
$donate->Message = $data['Message'];
$donate->SponsorshipPageID = $this->ID;
$donate->write();
return $this->redirectBack();
}
redirectBack()
returns a HTTPResponse
object, so you can manipulate that before you return it:
return $this->redirectBack()->addHeader('X-Foo', 'Bar');