Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add support for Inertia.js #1389

Closed
MichaelNZ85 opened this issue Feb 8, 2023 · 17 comments · Fixed by #1478
Closed

Feature request: Add support for Inertia.js #1389

MichaelNZ85 opened this issue Feb 8, 2023 · 17 comments · Fixed by #1478

Comments

@MichaelNZ85
Copy link

Inertia.js allows you to serve frontend framework components (React/Vue/Svelte components) directly from the Laravel code. It's essentially the "glue" that can stick the frontend and backend together without the need for an API.

However, Laravel + Inertia + React/Vue is not supported by the Laravel Debugbar. Since Inertia uses only one Blade template (which is essentially a master template), then the View tab in the Debugbar is pretty bare. It would be great if you could add support for Inertia, showing which component was rendered and which props were sent to said component.

@websolutionfalcon
Copy link

+1
It will be great to support Inertia

@TheKelvinPerez
Copy link

Yes +1 as well this would be an amazing feature

@harryqt
Copy link

harryqt commented Mar 29, 2023

+1

1 similar comment
@ArcheeNic
Copy link

+1

@oozone
Copy link

oozone commented Jul 20, 2023

Yes please, was a bit amazed I couldn't get it to working

@pilutiful
Copy link

Yes please +1

@khalidmaquilang
Copy link

any update on this?

@erikn69
Copy link
Contributor

erikn69 commented Oct 11, 2023

Try #1478 and let your review on the PR
Replace your ViewCollector.php with https://raw.githubusercontent.com/laravel-debugbar/src/DataCollector/ViewCollector.php on your vendor for testing

@harryqt
Copy link

harryqt commented Oct 16, 2023

Thank you for the patch, I can confirm its working for Svelte. 👍

Screenshot 2023-10-16 at 2 44 39 PM

@oozone
Copy link

oozone commented Oct 16, 2023

This is fantastic. Thank you all!

@harryqt
Copy link

harryqt commented Oct 16, 2023

Please, any review on #1478, that way there is a greater chance of it being merged.

That’s the PR I tested on Svelte. It works for me.

@philharmonie
Copy link

Unfortunately, it's not working with vue3.

@erikn69
Copy link
Contributor

erikn69 commented Mar 11, 2024

@philharmonie hi, tested on vue3, no problems
image
image

@khalidmaquilang
Copy link

@philharmonie hi, tested on vue3, no problems image image

Yeah! It is working on inertiajs

@philharmonie
Copy link

Yes it kinda works, but when I load e.g. 10 users return inertia('Users/Index', ['users' => User::all()]) it shows 10 models in the debugbar for a second and then immediately it refreshes and doesn't show the query for the users table.

@parallels999
Copy link
Contributor

then immediately it refreshes and doesn't show the query for the users table.

That is the ajax, it is the expected behaivor #1490
image
Check that selector, or disable it

'ajax_handler_auto_show' => true,

@philharmonie
Copy link

Oh thank you very much. I did not know that I am able to switch that. That's it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.