Advertisement
ayeniblessing

store

Oct 26th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. public function store(Request $request)
  2. {
  3. $validator = \Validator::make($request->all(), [
  4.  
  5. 'hospital_name' => 'required',
  6. 'address' => 'required',
  7. 'state' => 'required',
  8. 'country' => 'required',
  9. 'contact_person' => 'required',
  10. 'phone' => 'required',
  11. 'username' => 'required',
  12. 'password' => 'required',
  13.  
  14. ]);
  15.  
  16. if($validator->fails())
  17. {
  18. return $this->errorUnauthorized('Ensure you fill all field don\'t leave any empty');
  19. }
  20.  
  21.  
  22. User::create($request->all());
  23.  
  24. return $this->responseWithJson('User Registration successful');
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement