Custom browser tab title
Maybe this is a simple question but, when i visualize a resource, in the browser tab i get the title i choosse with
public function getTitle(): string
{
return __('customer.customers');
}
followed by a -
how can i customize this title to remove the - or add something after? (for example the title of the single resource when edit)
Thanks
7 Replies
Add the Application name to the .env? It should be like: APP_NAME="MY App"
i have the app_name ready but not appear in the tab and, i want to show the customer name while i view or edit his resource
something like Customer - John Bohnam
Very useful, was wondering about this, and saved me some time looking.
Works on
ViewRecord
, any idea how to replicate on EditRecord
@toeknee ?? 🫶It should work on View and Edit but not Create
ahh...actually, I'm accessing the edit in a slideover from the ViewRecord, rather than the Edit* page.
protected function getHeaderActions() : array
{
return [
EditAction::make()
->slideOver()
->form(DetailsForm::getForm()),
];
}
Suspect this makes the difference, and assume have to dive into the EditAction
class to influence that ?Correct, if it's not a page you cannot change the page title really from a slideOver without some custom JS. You should link to a page to change the page title. Instead change the modal header title and do the same with
->modalHeading(fn($record) => __('customer.customers') . $record->name)