Tuesday, May 23, 2017

How to update data from database in a view?

Using laravel 5.2. I am printing currency values from database in a view:

<div class="hidden">
@foreach ($currencies as $currency)
    <div class="currency-">
        <div class="cur-id"></div>
        <div class="cur-name"></div>
        <div class="cur-sell"></div>
        <div class="cur-buy"></div>
        <div class="cur-reserve"></div>
        <div class="cur-short"></div>
        <div class="cur-wallet"></div>
    </div>
@endforeach
</div>
@endsection

Code above lists all currencies from database with its fields. Question is - how can i update these values without page reload with Ajax? I need to make a GET request with ajax then replace data with actual one.



via Alexander Kim

Advertisement