title: POST localhost/.. 405 (Method Not Allowed)
body: <p>I was sending a request to a controller using Ajax but every time i got this errors:</p>
  
  <p>these 2 errors when i refresh the page:</p>
  
  <pre><code>1) Uncaught ReferenceError: $ is not defined
  
  2) Uncaught ReferenceError: Holder is not defined
  </code></pre>
  
  <p>and this error when i send request:</p>
  
  <pre><code>jquery-3.3.1.min.js:2 POST localhost/.. 405 (Method Not Allowed)
  send @ jquery-3.3.1.min.js:2
  ajax @ jquery-3.3.1.min.js:2
  (anonymous) @ 0:221
  dispatch @ jquery-3.3.1.min.js:2
  y.handle @ jquery-3.3.1.min.js:2
  </code></pre>
  
  <p>my code:</p>
  
  <pre><code>$.ajax({
      type:'POST',
      data:
      {
          "_token":$("input[name=_token]").val(),
          'question_id':question_id,
          'user_id':user_id
      },
           href:"{{route('favorites.reds')}}",
           success: function (data) {
               console.log(data);
      }
  })
  </code></pre>
  
  <p>the route:</p>
  
  <pre><code>Route::post('/questions/reds', "FavoritesController@addToReds")-&gt;name('favorites.reds');
  </code></pre>
  
  <p>Inputs:</p>
  
  <pre><code> &lt;i class="fa fa-heart" style="margin-right: 100px; cursor: pointer; " aria-hidden="true"&gt;
                          &lt;input type="hidden" value="{{$question-&gt;id}}" class="question_fav"&gt;
                          &lt;input type="hidden" value="{{Auth::user()-&gt;id}}" class="user_fav"&gt;
                      &lt;/i&gt;
  </code></pre>
  
  <p>Can anyone figure this out?</p>