Skip to main content

Same Component for Create and Edit Forms

Premium
4:00

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Vasile Jianu avatar

hi i can't get the existing selected values to be displayed in the select2 option field on the edit componet, any tip on how to do that thanks

Yeasin Rahman Siam avatar

Hello Vasile. did you use wire:model on select field..

Luis Scura avatar

And by using a single component for both, how do you handle the flash method to be different depending if the user was created or updated?

Luis Scura avatar

UPDATE: since I am using Livewire 3, I follow this instead and, I still had to create 2 seperate components but using one single form: https://laraveldaily.com/lesson/livewire-3/edit-product-form-object