Great explanation… i will prefer the form objects over the PHP attribute in cases like this.
@ermanarif31762 ай бұрын
Hi, i am from Indonesia. I want to ask... Can I use the updated hook from within a form object?
@rafp8778 Жыл бұрын
Fantastic explanation. Thank you.
@LamineAyobaGueye-s7l Жыл бұрын
hi I have a laravel project with livewire but every time I download a file the formuaire disappears
@mahmoud-bakheet Жыл бұрын
The both last 2 ways are very impressive especially the last one when you have large project With API and web routes and you need to use the same functionality , Then I don't mind about repeating "data" even I can name it anything useful
@codewithyohatube Жыл бұрын
Hi! thanks for you time make those amazing videos and i have some question pls help me I'm working laravel livewire project and i wanna run livewire in xampp but it wont work tried a lot watch a lot of tutorials but i cant find any solution
@LaravelDaily Жыл бұрын
I don't work with xampp so can't comment, sorry
@JohnnyBigodes Жыл бұрын
The Problem with Attributes is because you cant inject your own data. So it is better to use the rules() method to do this instead. Povilas talked about using the rules() method for complex rules, but I think with "complex" he meant using and injecting your own data. It doesnt mean this has to be complex. 👍
@wevertonlotosport Жыл бұрын
im thinking in this way too
@mahmoud-bakheet Жыл бұрын
yeah ...
@saeeedkhan Жыл бұрын
form objects in livewire tests?
@LaravelDaily Жыл бұрын
Haven't tried
@SussanRai Жыл бұрын
I think laravel should have default request form feature support like livewire for non livewire user.
@bw7868 Жыл бұрын
Thank you, and I think the best option to use something like Spatie laravel-data package. So you define everything in one placee "data objects", then use them whenever you need anywhere. Also this package supports livewire wireable out of the box, also this make the package a great option.
@LaravelDaily Жыл бұрын
Personally, it never sticks to me - those data objects or value objects are, yeah, "single place to define everything", but to me it feels too DEEP in the code. So I need to always search where that logic is defined. Also, it's tricky if the logic is "a little different" in various forms/validation. Do you have any open-source project where that Spatie laravel-data would be used for a longer form like in this video?
@mahmoud-bakheet Жыл бұрын
I think for the team there are no need to be deep like that because we have a lot of things else to focus on this is the solution I prefer, But I like the idea of Spatie laravel-data
@gymgymy Жыл бұрын
Yeah, we used Spatie Data in big forms, and it becomes pretty easy to handle once you get used to it. Moreover, we used the same Data object from receiving data from a 3rd-party API, then in Livewire components with user forms, in any other actions and services where we use this Model, and also sent it back to the API. One Data object in the entire model lifecycle. It's also quite nice in testing.