Вот мой Аякса код:использование Ajax в Laravel 5
$('select[id=currency-data]').change(function() {
var currency_id = $(this).val();
$.ajax({
url: "{{Route('exchange-rate')}}",
type: 'POST',
data: {currency_id: currency_id },
success: function(data){
$('#ex-rate').val(data);
}
});
});
Вид:
{!! Form::label('currency_id', 'Currency:', ['class' => 'control-label']) !!}
{!! Form::Select('currency_id', $currency_data, Input::old('currency_id'), ['id'=>'currency-data','class' => 'form-control','required']) !!}
{!! Form::label('exchange_rate', 'Exchange Rate:', ['class' => 'control-label']) !!}
{!! Form::input('number','exchange_rate', Input::old('exchange_rate'), ['id'=>'ex-rate','class' => 'form-control','readonly','required']) !!}
, когда я запускаю это, я получаю сообщение об ошибке: TokenMismatchException в VerifyCsrfToken.php ..
может кто-то дать решение ???