Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AlexSteele's avatar

Jetstream, Fortify, customizations and a (semi) disaster!

OK. Here was my process in succinctly:

  1. fresh install of laravel 8
  2. install jetstream with livewire stack
  3. ** using the profile photo files as an example, create a second set of all the files needed to add another photo / media to the user record. edit everywhere, and create all the files in the vendor/laravel/jetstream folder that makes this happen. create blade component for this, register it, add it to the structure. updated SQL tables.
  4. Everything has been working perfectly!
  5. I was going to use a new package to detect user agent, decided to install on CL per typical, was notified to update my version of composer
  6. ran composer update
  7. BOOOOM! It appears that all my additions and extra components, classes and parts that were added by me for the new media have been completely wiped out. The vendor folder is back to its original contents *********

I understand at this point what happened, and probably why.

The main quesion is - if we need to enhance and update the profile management experience and we are required to use a stack like livewire, with alpine, and all of those layouts are deep within a vendor folder and we are not able to make lasting changes in there that won't be killed with an update, is there some documentation on how to enhance outside of those structures - or if the documentation doesn't exist can the makers of jetstream post some?

0 likes
11 replies
davorminchorov's avatar

You do not add or modify files in the vendor folder. Publish the components and edit them that way in resources/vendor( I think that's the path, not sure).

As for Livewire and Alpine being the defaults, you have 2 options:

  • Remove them completely and rework the logic with your preferred stack
  • Use them just for the components that use them
AlexSteele's avatar

Yes, I know that we do not add or modify them in the vendor folder now, because that is the crux of my problem. As far as publishing the components and edit them in resources/vendor that is a step in the right direction, but I need more info. I don't have the information on how to do that, why, and I need a real set of documentation I can step through and make sure I am doing it correctly.

As far as livewire and alpine, I am standing my original post, that stated that I have made that choice and will stick with it. As I said, I am not complaining at all - but need more data to get up to speed.

MarianoMoreyra's avatar

Hi @alexsteele

I think you should check Jetsream documentation, specially the Structure section at the installation page: https://jetstream.laravel.com/1.x/installation.html#jetstream-structure

There you’ll also find the subsection for Livewire components: https://jetstream.laravel.com/1.x/installation.html#livewire-components

Where it says how to publish those assets:

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

I believe that could be a starting point...

Hope this helps!

1 like
AlexSteele's avatar

i was able to get my work back at least, and now possibly need to understand better where it should go. thanks to everyone who answered.

earlier in my process I created a new trait, called hasBrandPhoto - it was stored in jetstream/src/...

I understand that was wrong with storing them there, not sure I quite understand where we place addons for the profile management outside of this area? i found the other places to add blade components for the rendering of the components, not exactly sure where to put a new trait.

AlexSteele's avatar

the only reason I did it this way is because I was in a (hurry) and copied the profile image in the new scaffolding. i will check this out, thank you!

AlexSteele's avatar

I appreciate all the responses. I read the links about the components that are publishable and it was helpful. I am still uncertain of the next steps.

We needed to have an additional image as part of the user table and want to maintain the interface that the scaffolding provided, so I added a component to the Jetstream Scaffolding. It's called 'brand image' and it is basically a twin with the profile photo and used that as an example. Again, I understand this won't work long term if updating wipes out the changes

  1. created new file: vendor/laravel/jetstream/Http/Livewire/UpdateBrandInformationForm.php

  2. Import that new form into here: vendor/laravel/jetstream/stubs/inertia/resources/js/Pages/Profile

  3. Registered the component here: vendor/laravel/jetstream/src/ JetstreamServiceProvider/php

...use Laravel\Jetstream\Http\Livewire\UpdateBrandInformationForm;

... and also in the right under the one, I am mimicking Livewire::component('profile.update-profile-information-form', UpdateProfileInformationForm::class); Livewire::component('profile.update-brand-information-form', UpdateBrandInformationForm::class);

  1. the blade template, which is located in resources/views/profile/update-brand-information-form-blade.php

The question is if we want to want to add a feature to the scaffolding such as this new branding image how and where to do we make those changes outside of the vendor files where they both work with the scaffolding and are permanent and will not be deleted upon updates.

MarianoMoreyra's avatar
Level 25

@alexsteele let me see if I can help you regarding where to place every piece of custom code.

earlier in my process I created a new trait, called hasBrandPhoto - it was stored in jetstream/src/...

For this, you can create a Traits folder under app folder for example. Then you can create your trait in there (make sure you change the Namespace accordingly).

created new file: vendor/laravel/jetstream/Http/Livewire/UpdateBrandInformationForm.php

This should go under app\Http\Livewire\ folder (which you may need to create if you don't have it yet). Again, update Namespace to match the new location.

Import that new form into here: vendor/laravel/jetstream/stubs/inertia/resources/js/Pages/Profile

This shouldn't be needed in your case as you chose to work with Livewire instead of Inertia.

Registered the component here: vendor/laravel/jetstream/src/ JetstreamServiceProvider/php

Do this at the boot method in the JetstreamServiceProvider located under app\Providers instead of the one at vendor folder.

Beware although that you are registering 2 different clases for the same component, so the second one it's the only one it will work (if I'm not wrong).

Also, check that you are importing the App\Http\Livewire\UpdateBrandInformationForm instead of the vendor one. Actually, delete it from the vendor folder as you shouldn't have created that file there in the first place.

I think I've covered all your custom files but I might be missing something else.

I've made most of this steps in a fresh local project and got it working without touching the vendor folder so I believe it should work for you too.

Hope this helps!

3 likes
AlexSteele's avatar

Thank you so much! I am grateful for your help!

Please or to participate in this conversation.