1

I am new with this Laravel Debugbar, I have installed Laravel Debugbar using composer and run the following publish command.

php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"

After this the debug bar starts to appear and also shows all the queries it runs. But in this queries list it is not including any queries which are from ajax request.

To capture ajax request, I have updated config/debugbar

    'capture_ajax' => true,
    'add_ajax_timing' => true,

But, it doesnot work.

I am returning response as:

return response()->json([
    //arr_of_data
],200);
2
  • The debug bar has handlers for some common JS libraries, but not all. How are you making the calls? Commented Jan 26, 2021 at 15:34
  • What are you using to make the AJAX call? jQuery? Commented Mar 15, 2021 at 6:24

5 Answers 5

2

Make sure you have full access permission granted to the storage/debugbar folder!

This happened to me once when I decided I have to put storage/debugbar in the .gitignore, not noticing that there is a .gitignore file there that says exclude everything inside from git. So when I deployed it on the server I was seeing only the first request on the page (and when testing it on local I knew the ajax requests showed up in a dropdown). I noticed also that the history (that folder icon on the right of the bar) is empty. Found out the storage/debugbar folder had no write access, so when I gave it chmod 777 storage/debugbar, all the requests appeared. (And then I removed it from the .gitignore)

Sign up to request clarification or add additional context in comments.

Comments

1

Incase for datatable the following helped me:

<script>
    $('body').on('xhr.dt', function (e, settings, data, xhr) {
        if (typeof phpdebugbar != "undefined") {
            if (xhr.getAllResponseHeaders()) {
                phpdebugbar.ajaxHandler.handle(xhr);
            }
        }
    });
</script>

refer : here

Comments

0

There is another tab separate from the queries tab where you can see information about your ajax requests. It's the last tab on the lefthand side. See attached image. Debugbar request tab

1 Comment

My last tab looks like this : ibb.co/G7KcP0X But my ajax request is sent to /building. /floor-stack is the view.
0

set header

X-Requested-With: XMLHttpRequest

Comments

0

Make sure that your APP_URL in .env is the same as where you visit the app. I had the same issue using ngrok.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.