Morning gals and guys. In today's episode we'll talk about value objects and how they can be used. Twitter: / przylucki_p More me: saaslaravel.com Website: przemyslawprzy...
Пікірлер: 38
@alnahian2003 Жыл бұрын
This is currently my daily favorite channel 🍀 Sooo much indepth about those stuffs
@saaslaravel Жыл бұрын
Glad you enjoy it!
@mohamedalqady1220 Жыл бұрын
Me to 🎉
@free2idol1 Жыл бұрын
Awesome! I have used VO for a while but you've made it to the next level... I hope you can release a tutorial of making mini app using DDD architecture.
@saaslaravel Жыл бұрын
Thanks so much! Tutorial on my version DDD is on the immediate roadmap (and a secret project connected to it 😊)
@SemyonF897 ай бұрын
Yep! we need it!
@kenube Жыл бұрын
Great videos. Can you explain the difference between DTO & Value Object? Always confuse with this two terms.
@saaslaravel Жыл бұрын
Thank you! In simple terms: Value object is a wrapper on a primitive inside of your system - phone, email, point, coupon etc, whereas DTO is an object with all of the data required for execution of a certain logic. DTOs often times include VO
@kenube Жыл бұрын
@@saaslaravel Thanks for the clarification! I probably already use DTO without knowing 😖
@igorleal1798 Жыл бұрын
It would be great to have generics in PHP so you could just pass a to your interface and use the Phone instead of a generic ValueObjectInterface for your isEqual definition
@saaslaravel Жыл бұрын
That's what I tried to do with phpdoc off camera but couldn't get it to work unfortunately :c
@igorleal1798 Жыл бұрын
@@saaslaravel So sad... Hopefully, PHP will get native generics one day :D
@medilies Жыл бұрын
@@igorleal1798 there is a video by Brent where he explains why PHP can't have generics
@TheGajos5 ай бұрын
@@mediliesActually we can have generics in PHP, just like Python does (comments)
@medilies4 ай бұрын
@@TheGajos php annotations have no effect on runtime. they only improve IDE experience and work with static analyzers
@alexz75515 Жыл бұрын
I have learned so much from your videos, thank you! This type of videos are just awesome!
@saaslaravel Жыл бұрын
Thank you ❤️
@MarkSnape Жыл бұрын
I was puzzled by the interface. I thought you were going to extend a base value object class and put these common methods there?
@catalinul1461 Жыл бұрын
Hey mate! One question if I may, how would you handle transliteration when it comes to slugs in Laravel?
@saaslaravel Жыл бұрын
Hey! If you mean replacing characters like "ó" into "o" I think Str::slug handles that out of the box. If you mean localization - you could generate a slug that has a numeric ID and localized slug that's not taken into consideration in route binding i.e. "/blog/1-article"
@catalinul1461 Жыл бұрын
@@saaslaravel Yes, the first option, thank you very much! :D
@bangladesherp5210 Жыл бұрын
Great explanation!
@maguiskader7771 Жыл бұрын
Awesome 👌 can i have please the name of theme and the font😅 im addicted!
@saaslaravel Жыл бұрын
Thanks! It's called Fira Code
@maguiskader7771 Жыл бұрын
@@saaslaravel 🥳 thanks and theme?
@SussanRai Жыл бұрын
I think spatie laravel data package is better for this type of data transformation
@saaslaravel Жыл бұрын
It may be, but it's important to be able to understand what's happening under the hood or just being able to implement it from scratch! 😁
@SussanRai Жыл бұрын
@@saaslaravel I agree on this
@michaelrubel8776 Жыл бұрын
These look almost the same as the ones implemented in my package `laravel-value-objects` :)
@saaslaravel Жыл бұрын
Hi there! I was not familiar with your package but it looks pretty cool - I didn't copy the implementation from there though if that's what you are inferring :)
@michaelrubel8776 Жыл бұрын
@@saaslaravel No, I'm just surprised at how close our thoughts are to each other on this topic. Even methods like "from". :))
@saaslaravel Жыл бұрын
That's a common approach used in Laravel so that's probably why. I use that all of the time for DTOs as well
@niceteg3 ай бұрын
We miss you
@saaslaravel3 ай бұрын
I may or may not be getting back soon 👀
@niceteg3 ай бұрын
@@saaslaravel all your your videos are inspiring! Just buil some CRM example with DB structure and it will be the,🚀