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

Does not properly load its API inside Laravel Nova #225

Open
dm-pf opened this issue Apr 13, 2023 · 3 comments
Open

Does not properly load its API inside Laravel Nova #225

dm-pf opened this issue Apr 13, 2023 · 3 comments

Comments

@dm-pf
Copy link

dm-pf commented Apr 13, 2023

Hi, thanks for this awesome package ❤️ .

I've tried using it inside my Laravel Nova project - and the way Nova loads external-to-nova URIs is by loading them in a dialog window through an <iframe>. When that happens I get this window:

image

It seems that because the /log-viewer is loaded through an iframe - it loses track of the correct URI path to load its api/folders.

@arukompas
Copy link
Contributor

Hey @dm-pf can you share how you've added a link to the Log Viewer?

I'm not a Nova user, but I think what you're looking for is this:

use Laravel\Nova\Menu\MenuItem;

MenuItem::externalLink('Log Viewer', route('log-viewer.index'))

This is taken from Nova v4 docs btw:

https://nova.laravel.com/docs/4.0/customization/menus.html#menu-items

@dm-pf
Copy link
Author

dm-pf commented Apr 14, 2023

Hi @arukompas - using MenuItem::externalLink() (or MenuItem::path()->external() in my case) redirects to that URL which is exactly what I did after stumbling upon the above issue. Ideally, I would like to use it this way instead:

MenuSection::make('Log Viewer')
    ->path('/log-viewer')
    ->icon('lightning-bolt'),

Because that way I don't need to "get out" of my Dashboard and I can just load external tools in a dialog window. E.g. Laravel Horizon works fine this way.

Even though my use case is a bit particular (I doubt many people are using Nova) - I thought that reporting this would be a good idea because the issue itself could be triggered in other similar situations if not handled properly.

Thanks.

@asad6ek
Copy link

asad6ek commented Jun 12, 2023

Screenshot 2023-06-12 at 17 33 35

how can i use log-viewer in laravel nova. v1.9.1 is working but 2.* is not working

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

No branches or pull requests

3 participants