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?
20 Replies
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?
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:
Do you understand?
There is nothing about this in docs.
Put them in your resources, not in the panel.
Eg, UserResource
Typed property Filament\Navigation\NavigationItem::$label must not be accessed before initialization
I have put it in ViewUser.php
It assumes you know LaravelYou should before working with a laravel package
Jordii blocked.
it seems common sense where to put it, at the top of your resource or page
π
It works in UserResource.php
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 nameit 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
I can't change the header title of the Edit section using this:
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
the edit section does not have a nav label
only the resource does
it is not working.
its working just fine, you are just changing the wrong variable
Do you see where it says
$resource = UserResource::class
? That's the resource file. That's where you edit the $navigationLabel
he already did, he is prob talking about the breadcrumbs or title
That's what I literally said, must be used in a filament resource
Why should "navigation title" change the "header title"?