How do I change the title in Laravel Jetstream?

  • 0
    The question is in the title itself. Please share your thoughts and ideas. Otherwise, I don’t understand how to change the title using the standard ready-made layouts.
    Laravel Anonymous, Jun 28, 2019

  • 1 Answers
  • 0
    Today I decided to return to this issue and it seems like it happened. But I'm not sure yet what will work with dynamically changing header data.

    And so, the solution (possibly temporary):

    On the page where it should be displayed (index.blade.php, post.blade.php and similar style):

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

    PS: you can use other layers instead of x-guest-layout. Who's it shorter.

    Actually, in the layout itself, change the title tag to ...:

    <title>{{ $title }} - {{ config('', 'Laravel') }}</title>

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

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!