public function destroy($id)
 {
     User::destroy($id);
     Session::flash('message', 'Usuario eliminado');
     return Redirect::to('/user');
 }
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }
Exemple #3
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     \Agricola\User::create(['name' => $request['nombre'], 'email' => $request['email'], 'direccion' => $request['direccion'], 'telefono' => $request['tel'], 'type' => 'Cliente', 'password' => Hash::make($request['password'])]);
     Session::flash('message', 'Usuario registrado correctamente.');
     return view('user.crear');
 }
Exemple #4
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     \Agricola\User::create(['name' => $request['nombre'], 'email' => $request['email'], 'direccion' => $request['direccion'], 'telefono' => $request['tel'], 'type' => 'Empleado', 'password' => Hash::make($request['password'])]);
     return redirect('/admin/usuarios')->with('message', 'store');
 }