Skip to content

Conversation

@bishwajitcadhikary
Copy link
Contributor

Updated the title function to support pages without a custom title.
Now, if no title is provided, it will default to displaying only the appName.
This improves consistency across routes and prevents malformed titles like - AppName.

Before:

title: (title) => `${title} - ${appName}`

After:

title: (title) => title ? `${title} - ${appName}` : appName

The page component will only show the app name if it doesn't provide a title.
@Plytas
Copy link
Contributor

Plytas commented Jun 10, 2025

I swear I saw this PR being merged before. Turns out it was just for app.ts, not ssr.ts 👍
#140

@Plytas
Copy link
Contributor

Plytas commented Jun 10, 2025

Question to the team @taylorotwell @tnylea

Since both title and page resolver seems to be the same in both app.ts and ssr.ts, would it make sense to abstract them in let's say /resources/js/lib/utils.ts (or some other place)? This way it would be reused and most importantly consistent, without having to change it in 2 places all the time.

@bishwajitcadhikary
Copy link
Contributor Author

I swear I saw this PR being merged before. Turns out it was just for app.ts, not ssr.ts 👍
#140

You're right

@taylorotwell taylorotwell merged commit fbae2a4 into laravel:main Jul 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants