From the course: Building a Website with Laravel, React.js, and Inertia

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Changing the website title

Changing the website title

- [Instructor] Our title is broken right now as it shows dash Laravel. Something is obviously missing there, and that's because the app name is Laravel, but we haven't set a title of our website yet. Since Inertia apps are rendered within the documents body, as you can see here in the app.blade.php file, they cannot render markup in the documents head as it's outside of their scope. There are a couple of ways to set the title of our website. We could do it in the upload JSX file, and we could override the variables title and app name with whatever title we want our website to have. That would work, or we could use in initials head component, which can be used to set what you would normally set in the head component of the website, for example, the page title or meta text. Let's revert this back to what it used to be and use these variables to dynamically change the title's website. The app name is the value defined in the .env file, which we can update now. The title is the value we…

Contents