Esempio n. 1
0
 public function store()
 {
     $msg = new ContactMessage(Input::all());
     $msg->ip = getenv('REMOTE_ADDR');
     $okay = $msg->save();
     if ($okay) {
         $this->alertSuccess(trans('contact::message_sent'));
     } else {
         return Redirect::to('contact')->withInput()->withErrors($msg->getErrors());
     }
 }
Esempio n. 2
0
 public function store()
 {
     $msg = new JoinMessage(Input::all());
     $msg->ip = getenv('REMOTE_ADDR');
     $okay = $msg->isValid();
     if ($okay) {
         $team = Team::findOrFail(Input::get('team_id'));
         $msg = new ContactMessage(Input::all());
         $msg->title = 'Application of ' . $msg->username;
         $msg->text = '<strong>Team:</strong> ' . $team->title . '<br><br>' . '<strong>' . trans('app.role') . ':</strong> ' . Input::get('role') . '<br><br>' . '<strong>' . trans('contact::application') . ':</strong> <br><br>' . $msg->text;
         $msg->forceSave();
         $this->alertSuccess(trans('contact::message_sent'));
     } else {
         return Redirect::to('join-us')->withInput()->withErrors($msg->getErrors());
     }
 }
 public function show($id)
 {
     if (!$this->checkAccessRead()) {
         return;
     }
     $msg = ContactMessage::findOrFail($id);
     $msg->new = false;
     $msg->save();
     return $this->pageView('contact::admin_show', compact('msg'));
 }