Laravel + Service Pattern + DTOs = ❤️❤️❤️

preview_player
Показать описание
Hi guys!
In this video series, I'll be showcasing a simple way to integrate service pattern into existing Laravel applications. We'll start with a super simple example - an app that stores blog posts from the app and the api.

We'll do a couple of iterations before landing in type-safe service pattern solution that utilizes DTOs.

Рекомендации по теме
Комментарии
Автор

11:15 using `tap()` to get the updated model instance after the update.
This is a great thing for me.
Thanks for fabulous video.

freeidol
Автор

I had to take my time to understand this from the solution back to how it was implemented. This is insightful

kpomeru
Автор

One of the best videos which let’s you understand clever way to write code in just less than 20min.

Very very useful and pure.
Thank you!

SerGrus
Автор

Great video! Thats very similar to how we are structuring our application. I like your approach of showing the iterations, a good way to learn. Thanks.

natenatters
Автор

I really do not understand why add complexity and more entities when we have some methods in Laravel to get all the validated data from a request. I like and i employ the Service Pattern because we can separate the app business logic from models and controllers, but the DTO.. oh my... i can't see any need for this. I would like to see a Video from you about Model Events and BroadCasting them. Thank you and congratulations for your great work, Przemyslaw. Greetings from Brazil.

adrianoalves-qripto
Автор

huge improvement in the quality of my code after this, next level content

e-raticartist
Автор

I prefer to pass array into static DTO method, then Request, for me its much safety, u can use this DTO from wherever u want, not only from Controller. Example: tomorow u will need to create Post from console command or from Job

NoNameUkr
Автор

This is just awesome. Good job mate! To be honest I think you covered more than just Services and DTOs. Keep it up 👍

GayanSanjeewaKarunarathne
Автор

I would add the transformation method to request classes. In my opinion you should not have to extend DTO classes when adding new pieces of code eg. API v2 instead you should have a method called asDto(or toDto) in the request class and call them instead of making X static factory methods. Overall great content :)

Bre_d
Автор

This is a GEM! Thank you so much for sharing this. I really appreciate you!

peterpardo
Автор

wow, this was great <3, the only thing that could make this better was if there was a github link to the source code

SeyedaMansour
Автор

Loved this video, thanks! You explained many patterns and did very well. I would like a video from yourself explaining some real life scenarios where these patterns really shine by themselves. I’ll share this video.

soyarenamovediza
Автор

Nice tutorial!
You can check ide-helper to generate model auto completion for properties.

For dtos I find laravel-data by spatie a very good solution.

Cheers

midclock
Автор

You have great videos in laravel. keep this up

harshadevapriyankarabandar
Автор

Man, you are just awesome! Your content really helped me!

unknownstalker
Автор

Very very useful! Will definitely use it in my next project! Looks very promising.

sunnysk
Автор

Very nice, simple and clean description about Services and DTOs in Laravel, thanks man 👍

zachariascreutznacher
Автор

This video was really helpful, a lot of things now make sense. Thanks so much.

casweeney
Автор

thank you very mutch, this is very excelent video a bout laravel service pattern, 😍😍😍🥰

mohammadravand
Автор

When you have form request class included into ur method you dont need to do $request->validated cuz the data is already validated otherwise it throws validate exception until first line of code starts compile from function

VipStudio