title: Laravel unable to retrieve angular POST data
body: <p>I am submitting my form data through angular controller. The data then needs to be passed to Laravel Controller and stored in database. But, Laravel does not get the data and the values are NULL</p>
  
  <p><strong>Form</strong></p>
  
  <pre><code>&lt;form&gt;
      &lt;div class="form-group"&gt;
          &lt;label for="username"&gt;Your Name&lt;/label&gt;
          &lt;input type="text" class="form-control" id="username" name="username" placeholder="Your Name" ng-model="user.name"&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label for="useremail"&gt;Email&lt;/label&gt;
          &lt;input type="text" class="form-control" id="useremail" name="useremail" placeholder="Email" ng-model="user.email"&gt;
      &lt;/div&gt;
  
       &lt;div class="form-group"&gt;
           &lt;label for="username"&gt;Phone&lt;/label&gt;
           &lt;input type="text" class="form-control" id="userphone" name="userphone" placeholder="Phone" ng-model="user.phone"&gt;
       &lt;/div&gt;
  
       &lt;div class="form-group"&gt;
          &lt;label for="userpassword"&gt;Password&lt;/label&gt;
          &lt;input type="password" class="form-control" id="userpassword" name="userpassword" placeholder="Password" ng-model="user.password"&gt;
        &lt;/div&gt;
  
         &lt;button type="submit" class="btn btn-default" ng-click="addUser(user)"&gt;Submit&lt;/button&gt;
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>$http.get('http://api.app.mywebsite.com/users').success(function(data){
      $scope.user = data;
  </code></pre>
  
  <p>});</p>
  
  <pre><code>$scope.addUser = function(user){
  console.log($scope.user);
  $http({
      method: 'POST',
      url: 'http://api.app.mywebsite.com/users',
      dataType: 'json',
      data: $scope.user,
      headers: {'Content-Type': 'application/x-www-form-urlencoded' }
  }).then(function(result){
      console.log(result);
  }, function(error){
      console.log(error);
  })
  </code></pre>
  
  <p>}</p>
  
  <p><strong>routes.php</strong></p>
  
  <pre><code>Route::group(['middleware' =&gt; 'cors'], function()
  {
      Route::resource('users', 'UserController');
  });
  </code></pre>
  
  <p><strong>UserController.php store function</strong></p>
  
  <pre><code>public function store(Request $request)
  {
      $user = new User;
  
      $user-&gt;name = $request-&gt;input('name');
      $user-&gt;email = $request-&gt;input('email');
      $user-&gt;phone = $request-&gt;input('phone');
      $user-&gt;password = $request-&gt;input('password');
      $user-&gt;save();
  
  }
  </code></pre>