Can't get correct URL when saving form
I'm trying to conditionally show a tab based on url name, I have a normal edit resource page with /edit endpoint and another page with custom endpoint that is using Edit Resource.
When I'm on /edit endpoint I want to hide some tab and when I'm on custom endpoint I want to show that tab, which works to certain point when it comes to only refreshing the page.
If I dump request in visible() method on normal refresh I get multiple "/livewire/update" in dump, but in DOM I can see it has "/app/1/profiles/7/edit" uri (which is okay when I'm simply loading the page, since it's working as intended).
However, when submitting the form and dumping request it's as if things break at DOM level and the tab simply gets shown. I also noticed when I change date in some input field the tab gets shown*.
I'm not sure if there's another way of doing this, I tried to store things into session but couldn't get it to work correct and it takes some work to manage storing correct values in session. It also seems as if visible() method gets called multiple times for some reason and makes it even more weird to store values into session, since it's firing multiple times for different things.
Not sure what to do here anymore, seems like it should be quite simple to implement this, but now it got a bit more complicated.





14 Replies
Cant you use the
ProfileResource::getUrl('edit')
?
And when on that url hide it or make it visible
Depending on your caseTrying to test this out but am having a different problem now:
I'm getting "Missing required parameter for [Route: filament.app.resources.profiles.edit] [URI: app/{tenant}/profiles/{record}/edit] [Missing parameter: record]." even though I'm passing $record in correctly and it's having proper values.

also tried $record->id
even if I manually put in value I keep getting this error.
Oh, just noticed I haven't correctly set array as second param in function, will try it out now.
When I'm on custom endpoint it returns /edit endpoint


Hmm
I you just want the current url you can use
Request::
No, that's the problem, because livewire returns


I also tried if I could somehow get current route name correctly since I'm on custom route, but to no success.

this returns

Bump..
Ok so for a vie wor edit page you need to do:
He already did that right? https://discord.com/channels/883083792112300104/1333778811950727198/1333781745887219824
Just saw he is using tenacy too
true = isAbsolute
admin = the panel
$record->tenant = tenant model