Customizing the header on different record pages
How can I know that am on view record or edit record page so that I customize the heading of the page
18 Replies
For instance am on the edit page but I still have the title of create new child Yet i wanted it to be edit child
Where is your code for create form? You will just need the context added in
Like
fn ($context): int => $context === 'edit'
where do I add that context
You need to override the
function on resource page
Or as above, as @toeknee pasted, if it is based on context.
then what of view also
I have fixed it but am how can i make the gender show on the view page
Are you sure they have a gender on the edit as in your screenshot it's not selected.
I select gender on creation of a child and on the list page I have it as well but on show and edit the selected gender does not appear
I think there is something i need to do probably before the viiew or edit pages are rendered
You are not casting it to an array as per the select docs I suspect
ensure your model has
protected $casts =['gender' => array];
I have added it and created another child
but same issue
is it stored in the database
are you sure gender is fillable on the model
I had added gender in the $hidden i think it affects those pages
now it comes
How do I shift the save changes and cancel button to the right
Hidden means the values stay hidden... so yep that'll do it.
Yeah now it shows thank you so much
let me search how to shift those buttons to the right