Имам проблеми с опита да съхраня данни в 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';
}
Javascript е това:
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