title: Using AJAX with Laravel 5.5
body: <p>I'm building a web application using Laravel 5.5</p>
  
  <p>I created a basic user relationship system, and now I want to create a <code>add friend</code> button in the user profile. I don't want to wrap this inside a form just to send a friend request, so I was thinking to make a simple AJAX post request to the server passing the logged user id and the target user id:</p>
  
  <pre><code>$.post("/request/path", { "user_1": [...] }, function () {...});
  </code></pre>
  
  <p>However I'm new to Laravel (and routing in general) therefore I'm not sure if I should define a route in the api.php route file and make the request to, for example, <code>/api/friend-request</code>, or define a route in web.php like I did for login/register post requests. What's the proper way?</p>