У меня проблемы с попыткой сохранить данные в laravel, делая запрос ajax. У меня есть хороший маршрут.
Route::post('system/match_events/store','Match_eventsController@store');
Мой контроллер имеет метод хранения:
public function store(Match_eventRequest $request)
{
$params = $request->all();
$match_event = new Match_event($params);
$match_event->save();
return 'true';
}
Яваскрипт такой:
postData = {
_token: $('#form-hack input[name=_token]').val(),
player_id: "1",
match_event_type_id: "1",
match_id: "1",
team_id: "2",
};
$.post("{{ url('/system/match_events/store') }}", postData)
.fail(function(data) {
alert("There was an error with saving data: " );
});
Но он возвращает MethodNotAllowedHttpException
{{ url('system/match_events/store') }}
- person James   schedule 15.12.2015