Laravel 5.8 Ajax Crud Tutorial - Update or Edit Data

Поделиться
HTML-код
  • Опубликовано: 28 сен 2024
  • Learn How to Edit or Update MySQL Data in Laravel 5.8 by using Ajax and Bootstrap Modal. How to make Ajax Crud Application in Laravel 5.8 using Bootstrap modal without page refresh and reloading page. How to make Laravel 5.8 CRUD with modal and Ajax. How to fetch single row data and display on Bootstrap modal in Laravel 5.8 using Ajax. Laravel 5.8 Ajax Crud Tutorial from scratch.
    www.webslesson...

Комментарии • 19

  • @vageeshanvageesh5583
    @vageeshanvageesh5583 4 года назад +1

    He didnt mention anything about to add routes in the web.php. But that is available in the source code.In his source code the given route for the update function is not working for me. i dont know about for the others? he added, Route::post('ajax-crud/update', 'AjaxCrudController@update')->name('ajax-crud.update'); this line of code not working for me and i dont know where is the id for updating the row? that is the issue then i found the solution.That is given bellow
    Route::post('ajax-crud/update/{id}', 'AjaxCrudController@update')->name('ajax-crud.update'); and in the Route url
    url: "{{ route('ajax-crud.update','id') }}".I added the id.Any one have issues like this. try this code. Hope it will work.

  • @tdllezie3492
    @tdllezie3492 4 года назад

    Thank you from the heart

  • @joyaljames6993
    @joyaljames6993 4 года назад

    ajax is not working ..i followed every instructions..

  • @yashverma1896
    @yashverma1896 5 лет назад

    Edit Button is not working..Plz help..

    • @thesau1595
      @thesau1595 4 года назад

      can you provide a snippet ? i think this is working fine

    • @mizarzulmi1410
      @mizarzulmi1410 4 года назад

      @@thesau1595 I also experienced it

    • @thesau1595
      @thesau1595 4 года назад

      Can i see the code ?

    • @mizarzulmi1410
      @mizarzulmi1410 4 года назад

      @@thesau1595 cant post data ,
      if($('#action').val() == "Edit")
      {
      $.ajax({
      url:"{{ route('produk.update') }}",
      method:"POST",
      data:new FormData(this),
      contentType: false,
      cache: false,
      processData: false,
      dataType:"json",
      success:function(data)
      {
      var html = '';
      if(data.errors)
      {
      html = '';
      for(var count = 0; count < data.errors.length; count++)
      {
      html += '' + data.errors[count] + '';
      }
      html += '';
      }
      if(data.success)
      {
      html = '' + data.success + '';
      $('#sample_form')[0].reset();
      $('#store_image').html('');
      $('#user_table').DataTable().ajax.reload();
      }
      $('#form_result').html(html);
      }
      });
      }
      });

    • @thesau1595
      @thesau1595 4 года назад

      @@mizarzulmi1410 are you using data tables?

  • @whitecat9169
    @whitecat9169 5 лет назад +1

    the problem of the edit ajax it's / of url start

  • @leitoaros18
    @leitoaros18 4 года назад

    JAJAJAJA 10100101AJJAJA010101JAJ

  • @PritpalSingh-kz6kt
    @PritpalSingh-kz6kt 3 года назад

    Can you change image source on update?

  • @whitecat9169
    @whitecat9169 5 лет назад

    Hello Weblesson teacher.
    I'm have a problem with the edit method. I'm copied it method exactly but edit button don't show nothing. Can You help me please?.. than you in advance for your help!!