I have to pass parameters per post with ajax but not working on the console I get this:
POST http://localhost:8000/prueba2 405 (Method Not Allowed)
This is my routing:
Route::get('prueba2', 'HomeController@index');
This is my ajax:
$.ajax({
url: '{{url('prueba2')}}',
type: 'POST', // Send post data
data: 'type=fetch',
async: false,
success: function(s){
json_events = s;
}
});
This is my controller:
public function index(){
return 'hola';
}
All this is a test and is not the final driver nor the final ajax, but it seems to be some response by the controller. But unfortunately I get a 405.
If someone can help me with this serious problem it would be a lot of help