F
Filamentβ€’12mo 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β€’12mo 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
AlfaticOPβ€’12mo 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
AlfaticOPβ€’12mo ago
No description
Alfatic
AlfaticOPβ€’12mo ago
Do you understand? There is nothing about this in docs.
Joey 😎
Joey πŸ˜Žβ€’12mo ago
Put them in your resources, not in the panel. Eg, UserResource
Alfatic
AlfaticOPβ€’12mo ago
Typed property Filament\Navigation\NavigationItem::$label must not be accessed before initialization I have put it in ViewUser.php
Jordy
Jordyβ€’12mo ago
It assumes you know Laravel
You should before working with a laravel package
Alfatic
AlfaticOPβ€’12mo ago
Jordii blocked.
Jordy
Jordyβ€’12mo ago
it seems common sense where to put it, at the top of your resource or page πŸ’€
Alfatic
AlfaticOPβ€’12mo ago
It works in UserResource.php
Jordy
Jordyβ€’12mo 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
AlfaticOPβ€’12mo 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β€’12mo ago
the edit section does not have a nav label only the resource does
Alfatic
AlfaticOPβ€’12mo ago
No description
Alfatic
AlfaticOPβ€’12mo ago
it is not working.
Jordy
Jordyβ€’12mo ago
its working just fine, you are just changing the wrong variable
ChesterS
ChesterSβ€’12mo ago
Do you see where it says $resource = UserResource::class ? That's the resource file. That's where you edit the $navigationLabel
Jordy
Jordyβ€’12mo ago
he already did, he is prob talking about the breadcrumbs or title
Joey 😎
Joey πŸ˜Žβ€’12mo ago
That's what I literally said, must be used in a filament resource
Dennis Koch
Dennis Kochβ€’12mo ago
Why should "navigation title" change the "header title"?
Want results from more Discord servers?
Add your server