Пример #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUsersRequest $request)
 {
     // dd($request);
     $nuevoUsuario = new TUsuario($request->all());
     $nuevoUsuario->Pass = Hash::make($request->Pass);
     $nuevoUsuario->save();
     $message = 'Usuario añadido';
     Session::flash('message', $message);
     return redirect('Usuario');
 }
Пример #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update($id, CreateUsersRequest $request)
 {
     $users = USers::findOrFail($id);
     $users->update($request->all());
     $users->update(['password' => bcrypt($request->Password)]);
     Request::session()->flash('success', 'Uptodate successful!');
     return redirect("admin/users/" . $id . "/edit");
 }
Пример #3
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int $id
  * @param CreateUsersRequest $request
  *
  * @return Response
  */
 public function update(Staff $staff, CreateUsersRequest $request)
 {
     $staff->update($request->all());
     return redirect()->route('admin.staffs.index');
 }