title: How to write the correct AJAX URL in Laravel
body: <p>My AJAX file</p>
  
  <pre class="lang-js prettyprint-override"><code>function getLead(id) {
    $.ajax({
      type: "GET",
      url: "{{ url('leads/get_lead') }}",
      data: id,
      cache: false,
      dataType: 'json',
      contentType: "application/x-www-form-urlencoded;charset=UTF-8",
      success: function(data) {
        console.log(data);
      }
    });
  }
  </code></pre>
  
  
  
  <p>The result in console</p>
  
  <blockquote>
    <p>GET
    <a href="http://127.0.0.1:8000/reservation/%7B%7B%20url" rel="nofollow noreferrer">http://127.0.0.1:8000/reservation/%7B%7B%20url</a>('//leads/get_lead/')%20%7D%7D?_=1537345882551
    404 (Not Found)</p>
  </blockquote>
  
  <p>As you see it prints the whole URL as if it is a string.</p>
  
  <p>Do I write the URL in a wrong way?</p>