Example #1
0
 /**
  * @return bool
  */
 public function handle()
 {
     $this->newsletter->fill($this->input);
     return $this->newsletter->save();
 }
 /**
  * @param Campaign $newsletter
  * @param CampaignBuilder $builder
  * @param MailChimp $mailChimp
  * @return array
  */
 protected function detailedResponse(Campaign $newsletter, CampaignBuilder $builder, MailChimp $mailChimp)
 {
     $newsletter->load($this->relations());
     $newsletter->availableWidgets = $builder->getAvailableWidgets();
     //we need to check each locale if it's been linked to a campaign.
     //if so, we'll need to hook that campaign data onto the response.
     foreach ($newsletter->translations as $translation) {
         if ($translation->mail_chimp_campaign_id) {
             $this->loadMailchimpDataForCampaign($mailChimp, $translation);
         }
     }
     return $newsletter->toArray();
 }