Advertisement
envy90

laravel

Dec 19th, 2019
183
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. views>restaurant>index.blade.php.
  2.  
  3. web.php
  4. Route::resource('restaurant/id','restaurantController');
  5.  
  6. index (ajax)
  7. $('.modal-footer').on('click', '.edit', function() {
  8. $.ajax({
  9. type: 'post',
  10. url: 'restaurant/id',
  11. data: {
  12. '_token': $('input[name=_token]').val(
  13.  
  14. controller.
  15.  
  16. public function update(Request $req,$id) {
  17. $data = ipData::find($id);
  18. $data->first_name = $req->get('fname');
  19. $data->last_name = $req->get('lname');
  20. $data->save();
  21. return response ()->json ( $data );
  22. }
  23.  
  24. data and modal windows popup working fine…. but Update and Delete action’s isn’t working maybe because i have folder after view. Please help me. stress a lot. XD
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement