Peter Wyss
Peter Wyss

Reputation: 19

Laravel Jetstream components

Despite some research, I could not find any reference to how to customise Jetstream components such as 'welcome'. Maybe someone has a hint how to do this? Thanks!

Upvotes: 2

Views: 7144

Answers (3)

Igor
Igor

Reputation: 1172

If you want to create a custom Laravel Jetstream Blade component for example my-component or override a predefined one, there are steps:

  1. Create a Blade HTML template at, for example, resources/views/components/my-component.blade.php
  2. Edit the boot() method of JetstreamServiceProvider class at app/Providers/JetstreamServiceProvider.php

and add the code:

public function boot()
{
    //existing code....
    
    $this->callAfterResolving(BladeCompiler::class, function () {
        Blade::component('components.my-component', 'jet-my-component');
    });
}

Upvotes: 1

bazzlycodes
bazzlycodes

Reputation: 140

it easy to customize use

php artisan vendor:publish --tag=jetstream-views

to publish Components

go to resources/views/welcome.blade.php

edit and modify the blade file to suit your customization

Upvotes: 2

Yury Boichuk
Yury Boichuk

Reputation: 59

Try this:

php artisan vendor:publish --tag=jetstream-views

After that files will be available under the folder resources/views/vendor/jetstream/components

In this directory you will be able to find this welcome.blade.php

Upvotes: 6

Related Questions