/**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\ClienteRequest $request)
 {
     $cliente = new Cliente();
     $cliente->fill($request->all());
     $cliente->save();
     Flash::success('Usuario Creado Correctamente');
     return redirect()->back();
 }
Exemple #2
0
 public function saveCliente()
 {
     $input = Input::all();
     $rules = ['nome' => 'required|min:3|max:255', 'cookie' => 'required|min:3|max:255|unique:clientes', 'mysql_host' => 'required|min:3|max:255', 'mysql_pass' => 'required|min:3|max:255', 'mysql_base' => 'required|min:3|max:255'];
     $validator = Validator::make($input, $rules);
     if ($validator->fails()) {
         return $validator;
     }
     $cliente = new Cliente();
     $cliente->fill($input);
     $cliente->save();
     return $cliente;
 }