Use appName directly from .env in <title> #1329
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, appName in app.tsx is pulled via DOM from app.blade.php <title> tag. It works, but using it from .env seems like a better approach. Additionally, it serves as an example of how .env variables should be accessed in React/Vue.
The ssr template had 'Laravel' hardcoded as the app name, which is not great for SEO. Replaced that part with import.meta.env.VITE_APP_NAME as well.
This depends on laravel/laravel#6204 where I added VITE_APP_NAME as an alias to APP_NAME
I don't think any changes in this PR could be considered breaking.
Similar issue fixed in Breeze: laravel/breeze#292