public function postSubmit()
    {
        $rules = [
            'first_name' => 'required',
            'last_name'  => 'required',
            'email'      => 'required',
            'message'    => 'required',
        ];

        $input = Binput::only(array_keys($rules));

        $val = Validator::make($input, $rules);

        if ($val->fails()) {
            return Redirect::to($this->path)->withInput()->withErrors($val);
        }

        $this->throttler->hit();

        Mailer::send($input['first_name'], $input['last_name'], $input['email'], $input['message']);

        return Redirect::to('/')->with('success', 'Your message was sent successfully. Thank you for contacting us.');
    }
public function postSubmit()
    {
        $rules = [
            'first_name' => 'required',
            'last_name'  => 'required',
            'email'      => 'required',
            'message'    => 'required',
        ];

        $input = Binput::only(array_keys($rules));

        $val = Validator::make($input, $rules);

        if ($val->fails()) {
            return Redirect::to($this->path)->withInput()->withErrors($val);
        }

        $this->throttler->hit();

        Mailer::send($input['first_name'], $input['last_name'], $input['email'], $input['message']);

        return Redirect::to('/')->with('success', 'Your message was sent successfully. Thank you for contacting us.');
    }
public function postSubmit ( ) { $ rules = [ 'first_name' => 'required' , 'last_name' => 'required' , 'email' => 'required' , 'message' => 'required' , ] ; $ input = Binput :: only ( array_keys ( $ rules ) ) ; $ val = Validator :: make ( $ input , $ rules ) ; if ( $ val -> fails ( ) ) { return Redirect :: to ( $ this -> path ) -> withInput ( ) -> withErrors ( $ val ) ; } $ this -> throttler -> hit ( ) ; Mailer :: send ( $ input [ 'first_name' ] , $ input [ 'last_name' ] , $ input [ 'email' ] , $ input [ 'message' ] ) ; return Redirect :: to ( '/' ) -> with ( 'success' , 'Your message was sent successfully. Thank you for contacting us.' ) ; }
Submit the contact form.

@return \Illuminate\Http\Response
Submit the contact form .