From dbf3a074f7c1248d5069c6c87157b45be67dc7af Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 11 Jan 2017 14:52:05 -0800 Subject: [PATCH] Fix CSRF issue on bootstrap tables --- public/assets/js/bootstrap-table.js | 6 +++++- resources/views/layouts/default.blade.php | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/assets/js/bootstrap-table.js b/public/assets/js/bootstrap-table.js index f8715e9c4d..1c891bbc54 100755 --- a/public/assets/js/bootstrap-table.js +++ b/public/assets/js/bootstrap-table.js @@ -254,7 +254,11 @@ cache: true, contentType: 'application/json', dataType: 'json', - ajaxOptions: {}, + ajaxOptions: { + headers: { + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') + } + }, queryParams: function (params) { return params; }, diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index 54928b8199..1577198890 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -25,9 +25,7 @@ - +