title: Laravel 5 Decode Post Method URL
body: <pre><code>data=%7B%22password%22%3A%221234%22%2C%22username%22%3A%22user1234%22%7D&amp;
  </code></pre>
  
  <p>I have this type url from a POST request and decoded it looks like this...</p>
  
  <pre><code>data = {"password":"1234", "username":"user1234"}&amp;
  </code></pre>
  
  <p>In my case, I'm trying to decode with Laravel but it doesnt work properly.  How can I achieve this?</p>
  
  <pre><code>&lt;?php
  
  function login(Request $request)
  {
      $requestData = $request-&gt;request-&gt;get('data');
  
      $data = json_decode($requestData, true);
  
      $username = $data['username'];
      $password = $data['password'];
  
      return new JsonResponse($username);
  }
  </code></pre>