Ejemplo n.º 1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, Contactform::$rules);
     $input = Input::all();
     $contact = Contactform::create($input);
     return Redirect::action('ContactController@index')->with('message', 'Recibimos tu mensaje. ¡Nos pondremos en contacto pronto!');
 }
Ejemplo n.º 2
0
 public function destroy($id)
 {
     if ($contact = Contactform::whereId($id)->first()->delete()) {
         return Redirect::action('ContactFormController@index')->with('message', 'Mensaje eliminado.');
     } else {
         Session::flash('message', 'Algo salio mal');
         Session::flash('classMessage', 'danger');
         return Redirect::action('ContactController@index');
     }
 }