D
D
Dmitry Kuznetsov2020-11-16 11:26:39
Laravel
Dmitry Kuznetsov, 2020-11-16 11:26:39

How to change title in Laravel Jetstream?

The question is in the title. Please share your thoughts and ideas. Otherwise, I don’t understand how to change the title using the standard ready-made layouts.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kuznetsov, 2020-12-01
@dima9595

Today I decided to return to this issue and it seems to have worked out. But I'm not sure yet what will work with dynamically changing header data.
And so, the solution (probably temporary):
On the page where it should be displayed (index.blade.php, post.blade.php and in this style):

<x-guest-layout>
    <x-slot name="title">{{ __('Home Page') }}</x-slot>
</x-guest-layout>

PS: you can use other layers instead of x-guest-layout. Who's shorter.
Actually, in the layout itself, change the title tag to...:
<title>{{ $title }} - {{ config('app.name', 'Laravel') }}</title>

And everything works. Since I also understand what and how in the components of blad, I have not yet worked with dynamic replacement (data from the database, for example). In the future, as soon as I understand what works, I'll unsubscribe.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question