SHARE
TWEET

Untitled

a guest Jun 25th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function change($id)
  2.     {
  3.         $user = User::find($id);
  4.  
  5.         $user->name = request("name");
  6.  
  7.         $user->date_of_birth = request("date");
  8.  
  9.         $user->email = request("email");
  10.  
  11.         $user->phone = request("phone");
  12.  
  13.         $user->address = request("address");
  14.  
  15.         $user->city = request("city");
  16.  
  17.         $user->postcode = request("postcode");
  18.  
  19.         $validator = Validator::make(request(), [
  20.             'name' => 'required',
  21.             'email' => 'email|string|max:255|unique:users',
  22.             'phone' => 'required|numeric',
  23.             'address' => 'required|numeric',
  24.             'postcode' => 'required|numeric',
  25.             'city' => 'required'
  26.         ]);
  27.         if ($validator->fails()) {
  28.             return redirect("/user/edit")
  29.                 ->withErrors($validator)
  30.                 ->withInput();
  31.         }
  32.         $user->save();
  33.  
  34.         return redirect('/user');
  35.     }
  36.      
  37. $validator = Validator::make(request()->all(), ...
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top