Пример #1
0
 public function save(Request $request)
 {
     $this->validate($request, ['email' => 'required|email|max:255']);
     $registro = new Registro();
     $registro->email = $request->email;
     $registro->save();
     return "Registro guardado Ok";
     /*
             if ($validator->fails()) {
     
                 return redirect('formulario')
                             ->withErrors($validator)
                             ->withInput();
             }
     */
     return $input = $request->all();
 }
Пример #2
0
 public function destroy($id)
 {
     $registro = Registro::find($id);
     $registro->delete();
     Session::flash('message', 'Registro eliminado correctamente!');
     return redirect('registro');
 }