F
Filamentβ€’6mo ago
Alfatic

In which file should I put navigation related things?

I find out that the docs often miss the "where" should you put something, in which file. It assumes you know Laravel and Filament already, which is weird. One recent thing I found is this: Btw, in which file should I put it?
No description
20 Replies
toeknee
toekneeβ€’6mo ago
It states that resources and custom pages contain the static properties. So you would put it in the resource and pages you want it to be in?
Alfatic
Alfaticβ€’6mo ago
I don't understand. I am struggling with Filament docs in general. In comparison with Livewire docs it's very beginner unfriendly. Can you recommend any better source of learning Filament. Because to be honest your response doesn't make any sense to me at all. What does static property of a class have to do with navigation file location? What do you mean by the "resource"? Which file? in public function panel methods shows this:
Alfatic
Alfaticβ€’6mo ago
No description
Alfatic
Alfaticβ€’6mo ago
Do you understand? There is nothing about this in docs.
Joey 😎
Joey πŸ˜Žβ€’6mo ago
Put them in your resources, not in the panel. Eg, UserResource
Alfatic
Alfaticβ€’6mo ago
Typed property Filament\Navigation\NavigationItem::$label must not be accessed before initialization I have put it in ViewUser.php
Jordy
Jordyβ€’6mo ago
It assumes you know Laravel
You should before working with a laravel package
Alfatic
Alfaticβ€’6mo ago
Jordii blocked.
Jordy
Jordyβ€’6mo ago
it seems common sense where to put it, at the top of your resource or page πŸ’€
Alfatic
Alfaticβ€’6mo ago
It works in UserResource.php
Jordy
Jordyβ€’6mo ago
the anwser is in the docs and also given to you by toeknee,
By default, the navigation label is generated from the resource or page's name
it doesnt make sense to put it anywhere but the resource or page.. you complained in the laravel discord about the docs too but you just dont take the time to read propperly
Alfatic
Alfaticβ€’6mo ago
I can't change the header title of the Edit section using this:
protected static ?string $navigationLabel = 'Mis Clientes';
protected static ?string $navigationLabel = 'Mis Clientes';
It works only in the menu in sidebar if used in the resource php file --- But it is not working in pages itself. For example, if I try this in EditUser.php page file
Jordy
Jordyβ€’6mo ago
the edit section does not have a nav label only the resource does
Alfatic
Alfaticβ€’6mo ago
No description
Alfatic
Alfaticβ€’6mo ago
it is not working.
Jordy
Jordyβ€’6mo ago
its working just fine, you are just changing the wrong variable
ChesterS
ChesterSβ€’6mo ago
Do you see where it says $resource = UserResource::class ? That's the resource file. That's where you edit the $navigationLabel
Jordy
Jordyβ€’6mo ago
he already did, he is prob talking about the breadcrumbs or title
Joey 😎
Joey πŸ˜Žβ€’6mo ago
That's what I literally said, must be used in a filament resource
Dennis Koch
Dennis Kochβ€’6mo ago
Why should "navigation title" change the "header title"?
Want results from more Discord servers?
Add your server
More Posts