title: Laravel ajax request to controller
body: <p>Hi I'm getting weird answer form my ajax request. This is my controller's method returning one of the id:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  
  //use App\Http\Requests;
  use Illuminate\Support\Facades\Auth;
  use Illuminate\Support\Facades\DB;
  
  use App\Source;
  use Illuminate\Support\Facades\Redirect;
  use Illuminate\Support\Facades\Input;
  use Illuminate\Support\Facades\Response; //para user input post ajax
  
  
  class RelationshipController extends Controller
  {
      public function __construct()
      {
          $this-&gt;middleware('auth');
      }
      public function getUserId()
      {
          return "123";
      }
  }
  </code></pre>
  
  <p>This is my route:</p>
  
  <pre><code>Route::group(['middleware' =&gt; ['web']], function () {
  
      Route::post('/requestId', 'RelationshipController@getUserId');
  
  });
  
  Route::get('/home', 'HomeController@index');
  Route::resource('relationship', 'RelationshipController');
  </code></pre>
  
  <p>and this is my ajax request:</p>
  
  <pre><code>$("#consulta").click(function(){
      $.ajax({
          url: "requestId",
          type: 'post',
          data: {_token: CSRF_TOKEN, 'email': 'hihi'},
          success: function (data) {
              console.log(data);
          }, error: function () {
              alert("error!!!!");
          }
      });
  
  });
  </code></pre>
  
  <p>I don't know why I'm getting this answer:</p>
  
  <pre><code>Object {message: ""}
  message:""
  __proto__:Object
  </code></pre>
  
  <p>What is wrong here? The route out of the route group doesn't work either. Im here btw: </p>
  
  <pre><code>Route::get('/createrelationship2/{og}/{dest}/{xchange}', 'RelationshipController@createrelationship2');
  </code></pre>
  
  <p>If I am on "/public/createrelationship" the ajax call works if I am on "/public/createrelationship2/10/5/1" the ajax call doesn't work. I don't understand..</p>