Laravel X可编辑的CRSF问题

I followed documentation and another support article however I am still stuck. I want to be able to edit a field with x-editable.

  • I used what they said on here
  • I have CSRF meta tag in view file

I am getting the error;

UnexpectedValueException in Response.php line 403:
The Response content must be a string or object implementing __toString(), "boolean" given.

Js.

$.ajaxSetup({
headers: {
 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
}
});

$(document).ready(function() {


//toggle `popup` / `inline` mode
$.fn.editable.defaults.mode = 'inline';


$.fn.editable.defaults.params = function (params) {
   params._token = $("meta[name=token]").attr("content");
   return params;
};

$.fn.editable.defaults.send = 'always';

  //make parking editable
  $('#parking').editable();
});

In your controller, do

public function quicUpdate(Request $request, $id)
{
    ...
    $event->save();
    return response()->json($event); //This will return the whole event object
}