DoSomething/user-api — pull request #5 by codal-sara (2014-11-26 03:54:04+00:00)
Title: Ability to update user data using PUT

#### What's this PR do?
1. I changed the "users" route to use an implicit controller instead of a resourceful one. In Laravel's resourceful controller, the "update" action does not support query parameters when the HTTP PUT method is called on the route. The "update" method was changed to "putUsers" in order to define my own functionality for PUT.

2. Adds detailed error message for incorrect validation to JSON response upon registering a new user.

3. Allows JSON data to be used as input parameter for POST & PUT methods.

4. I cleaned up creating/updating of User Eloquent model code to loop through array of input values as opposed to checking each value individually.

5. Included test cases for retrieving a user using PHPUnit

#### Where should the reviewer start?
Most of the changes have been made to the user controller located in app/controllers/UserController.php. The unit tests are located in UserTest.php in the app/tests directory.

#### How should this be manually tested?
This endpoint should be tested by conducting a Curl request: Specify the PUT method & pass data in JSON format to a particular user:

curl -X PUT --data "email=new@updated.com" http://homestead.app/1/users?drupal_uid=123456