We wanted you Przemysław Przyłucki ? ?How are you ? why you dony push video ? push video about you , channel please!!!!
@abdulrehman-it7rp2 күн бұрын
Plz explain why you are using such complex things pipelines, ___invoke function, Just if condition for fillter , and if it is too mush code put it in traits
@programmertelo8 күн бұрын
thanks for the great video
@julendominadas404011 күн бұрын
i have never worked with any php framework before. Its funny to see that back when i started learning php i designed a request handler that seems pretty similar to this piece of laravel.
@B0re_d19 күн бұрын
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 :)
@nikolayrogoza424025 күн бұрын
Great tips, but i more like to use different actions as class, not as a part of service. Its easy to extend from basic model to others
@pattystaricha799Ай бұрын
Any tips for getting this to work with Vue 3?
@josephmakram4342Ай бұрын
This is awesome, i hope you deep dive on DDD on the next episodes
@mohammadjavadrajabloo2711Ай бұрын
Good Video!
@nicolascanala9940Ай бұрын
Man you would love C# haha. Thanks for the video!
@dyrossaurАй бұрын
Use handle() method instead, not the __invoke().
@nicolascanala9940Ай бұрын
Hey! How do you approach having different validation rules in the store and update actions? For example, a StoreBlogRequest which marks all fields as required, VS an UpdateBlogRequest which doesn't (for example, you just wanna update the name). Would you create more than one DTO and mark the properties as nullable?
@saaslaravelАй бұрын
Hey there! It depends on the situation, generally speaking with updates I'd not go with nulls because partial updates are pretty sexy - if you use spatie/laravel-data - they handle it out of the box with Optional type hint
@patricknelsonАй бұрын
Hopefully if you're going to be making upstream requests on every page load (or every user login) the developer will be making sure to perform reasonable caching. Since this is Laravel it should be pretty configurable, but something to be conscientious of. Also, presumably the upstream service (e.g. growthbook, in this case) is utilizing standard HTTP cache headers that Guzzle can respect and cache centrally using the configured middleware (e.g. memcached if you're on a cluster or something).
@saaslaravelАй бұрын
It's been cached in the video I believe. The http call is only made for fetching flags, they are resolved locally. Great piece of advice though!
@3dxspx703Ай бұрын
Yikes. Model mutators and observers will be enough guys. But if you want to Over-engineer your code, then go on with dto or something like repository pattern. 😅
@saaslaravelАй бұрын
Until your app had 1200 endpoints and some places haven't been touched for years - yeah
@3dxspx703Ай бұрын
@@saaslaravel yeah? But I prefer laravel's defaults for easier maintenance and debugging. Also KISS. Pfft
@LowViАй бұрын
Really good man! I would like to know what you think about adding an extra layer: the repository. Because thats kinda whats going on my in job rn, laravel + service pattern + dto + repository, I feel like the Model itself could act as the Repository, what do you think?
@saaslaravelАй бұрын
It really depends on what you are looking for from the solution. I'd say - if you don't have a good reason to introduce a repository - don't do it. If you want to have more fine grained control over your persistence layer (i.e to handle CQRS more easily) go for repository!
@ChugoualeАй бұрын
Awesome video series. what laravel version is this ?
@saaslaravelАй бұрын
I believe it was 10
@PavelbrovАй бұрын
17:20 - Shouldn't our DTO have a method like toArray so that we can manually avoid passing all the parameters? I mean, they correspond to the properties of the model. Or is this a bad practice? Like this public function toArray(): array { $properties = get_object_vars($this); $array = []; foreach ($properties as $key => $value) { $snakeCaseKey = Str::snake($key); $array[$snakeCaseKey] = $value; } return $array; } and then BlogPost::create($dto->toArray());
@saaslaravelАй бұрын
I prefer to be explicit when possible, realistically, just use spatie/laravel-data which handles this out of the box
@PavelbrovАй бұрын
5:50 - what about duplication in BlogPostRequest validation for api and app? Can we get rid of it?
@icantchosemynameАй бұрын
I didn’t know about pipeline but i think laravel provides the "when()" method on query builder instances. It’s simple and "eloquent" (pun intended 😂 ) i think but you probably already know about it. Your post seems to be for demonstrating the pipeline tool, thanks.
@HieuNguyenTrung-ud6djАй бұрын
I think we should use RepositoryContract interfaces instead of Repository classes in the constructors of Handler classes.
@saaslaravelАй бұрын
You're completely right! That was a brain fart on my end!
@niceteg2 ай бұрын
We miss you
@saaslaravel2 ай бұрын
I may or may not be getting back soon 👀
@niceteg2 ай бұрын
@@saaslaravel all your your videos are inspiring! Just buil some CRM example with DB structure and it will be the,🚀
@nobodyspecial9462 ай бұрын
Mordo, if you use AWS there is a native way to integrate it though Event Bridge - almost no code solution and you don't pay for lambda invoke. Trust me mordziu I am an engineer. But well explained, thumb up
@saaslaravel2 ай бұрын
Prawdopodobnie najlepszy komentarz jaki kiedykolwiek dostalem, dzieki za rade xd
@LucasOliveira-ny6kw2 ай бұрын
.
@midclock2 ай бұрын
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
@saaslaravelАй бұрын
Yeah I use both of them in my workflow! Def worth checking out for anybody interested though!
@vovkko2 ай бұрын
you can go further and return dto from custom request method (getDto()) which return dto class, inside that getDto method you can pass validated() as array to dto constructor, and write typed getter methods with default values (via ??) if api or app didnt receive some values from user
@IleniaQuintero2 ай бұрын
Hello, I was looking at your video channel. We may be helping a company that uses secure images to increase supply chain security and help cloud native development. Would you be willing to help try their software, make a video, and help show devs how to use their tools? This is not an offer, but just to start a conversation about your willingness to take on sponsorship. Please provide me with your email if you are interested. You'd have a chance to look at their technology and decide if it's the type of software that you'd be interested in covering in your channel.
@saaslaravelАй бұрын
You can find my deets on przemyslawprzylucki.com
@XTishka19802 ай бұрын
Amazing! Thank you for your lessons
@e-raticartist2 ай бұрын
huge improvement in the quality of my code after this, next level content
@israeliloba2 ай бұрын
Am getting something went wrong error
@unknownstalker26243 ай бұрын
Man, you are just awesome! Your content really helped me!
@bijayaprasadkuikel51623 ай бұрын
But why are not you using composition API?
@jirikolapa42923 ай бұрын
How do you handle replica lag?
@JSONFX3 ай бұрын
What font are you using on this video? Thanks!
@99Spyder993 ай бұрын
Can this be implemented with repository pattern? to have for example in EmojiRepository in the function getFilterableEmojis() can we move here the logic with the pipeline to return just $filterable->builder->get() and in the controller to have like return EmojiResource::collection( $emojiRepository->getFilterableEmojis($request) );
@99Spyder993 ай бұрын
Can you please put the code on git after you finish a tutorial?
@VipStudio3 ай бұрын
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
@VipStudio3 ай бұрын
And you dont need to use Dto u can just do create($request) //already validated clean data
@AbderrahmanFodili3 ай бұрын
Amazing stuff. I did sth weird to handle this . I added a helper method that returned an array with the key being the"Exception::class" and the value being either an array or a closure that returns an array as well this array always has a code and a message . this way I managed to also handle Laravel's own exceptions but your way of doing it is the Laravel way through the register method
@haingocduong51454 ай бұрын
Eloquent is a Repository . Don't use Repository Pattern if your Repository get data by Eloquent . it's meaningless
@C0DE84 ай бұрын
Hello, thank you for your great tutorials! THX 🙏 I've 1 question, what is your PHPStorm Theme + Font + Font size Editor & Project Path. Thanks in advance. ☺
@C0DE84 ай бұрын
Great Tutorial! THX. 👍 One question, what us your PHPStorm Theme? Thanks in advance.🙏
@AhmadAli-jb6ri4 ай бұрын
❤❤ Thanks for this tutorial...
@akhileshkumar-iu9uq4 ай бұрын
Can u name the vscode extension which make ur code very real
@DougLopes4 ай бұрын
I love your channel and content, but its almost impossible remember your channel name when i want rewatch some video as a brazillian, have you considered rename the channel for something more acessible since your content is global?
@abdulsalamamtech3 ай бұрын
That's a good notice. I also find it difficult to pronoun or type.
@JohnSmithhh4 ай бұрын
BEST video on the subject! Thanks for the time saved!
@2nauq9954 ай бұрын
Clear and concise. Subscribed!
@DailyTechShot4 ай бұрын
Please people, do not use a repository pattern in Laravel. Laravel has a beautiful active record solution and a repository pattern would only make sense when you would actually want to swap your database implementation, from let's say Mysql to Mongo for example. Do not use 'patterns' for the sake of using them. .
@hydrokat1432 ай бұрын
eloquent can switch over databases with some config changes in the database config and/or eloquent model. question is… is switching from sql to nosql or vv a thing?
@soyarenamovediza64985 ай бұрын
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.
@MrSfinks135 ай бұрын
Thank you! Very useful video, realy!
@user-fx1qh8ml5v5 ай бұрын
Its better to use BlogPost::query()->toBase()->first() instead of BlogPost::first()->toArray(), because in second scenario, laravel convert array from DB to Eloquent, and convert eloquent to array. In first scenario you get raw data without converting
@user-fx1qh8ml5v5 ай бұрын
Its better to use BlogPost::query()->toBase()->first() instead of BlogPost::first()->toArray(), because in second scenario, laravel convert array from DB to Eloquent, and convert eloquent to array. In first scenario you get raw data without converting