public function onContact() { $setting = Setting::first(); $data = \Request::all(); Contact::create($data); \Mail::send('genius.base::contact', $data, function ($message) use($setting, $data) { $message->to($setting->form_email); $message->replyTo($data['email'], $data['name']); }); return 1; }
/** * Deleted checked contacts. */ public function index_onDelete() { if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) { foreach ($checkedIds as $contactId) { if (!($contact = Contact::find($contactId))) { continue; } $contact->delete(); } Flash::success(Lang::get('genius.contacts::lang.contacts.delete_selected_success')); } else { Flash::error(Lang::get('genius.contacts::lang.contacts.delete_selected_empty')); } return $this->listRefresh(); }