Refactoring real-world Laravel app. Who wrote THIS CODE?!

  Рет қаралды 10,438

Przemysław Przyłucki

Przemysław Przyłucki

Күн бұрын

Пікірлер: 28
@limitlesskode
@limitlesskode Жыл бұрын
The refactor when you delegated the user service instantiation to laravel was quite cool. I was manually creating these instantiations in the constructor body and I think I will refactor to your approach.
@natenatters
@natenatters Жыл бұрын
I really like the refactoring videos! Nice job. Good to aim for the 80/20 rule too, you seem to get a lot of work done quickly!
@saaslaravel
@saaslaravel Жыл бұрын
Thank you Nathan! I'm learning Vim so maybe I'll be able to push that speed even further 😊
@natenatters
@natenatters Жыл бұрын
@@saaslaravel Oh no 😆Im happy to watch you work in Vim, but I refuse to learn it as an IDE haha
@saaslaravel
@saaslaravel Жыл бұрын
@@natenatters It's def challenging but that's what makes it fun haha :D
@Vitalii-m6r
@Vitalii-m6r Жыл бұрын
It's a very useful video! Looking forward to seeing more of these)
@binaryfire
@binaryfire Жыл бұрын
Great video! What are your thoughts on actions vs services?
@saaslaravel
@saaslaravel Жыл бұрын
I use actions as well - mostly when there a piece of logic that needs to be reused between different parts of the system, or when a service method has to interact with a 3rd party
@2gbeh
@2gbeh 7 ай бұрын
When to use Actions and when to use Traits ?
@gotoslovakia
@gotoslovakia Жыл бұрын
Great job. Thank you
@mohammadashrafuddinferdous9347
@mohammadashrafuddinferdous9347 Жыл бұрын
At 8:24, UserService isn't the appropriate service class. It should be user order service if there are any other type of order services. Otherwise, user service will be a god service, sooner or later. And i think usrr service should always return user objects. It can be user model or dto or the collection of dto or user models. But when it returns anything else, it breaks the law of diameter.
@saaslaravel
@saaslaravel Жыл бұрын
This project isn't super complicated and doesn't have loads of code, but if I was working on something more complex, I agree that UserOrderService is better
@mohammadashrafuddinferdous9347
@mohammadashrafuddinferdous9347 Жыл бұрын
@Przemysław Przyłucki Surely, if it's not complicated and only one person is working on it, then the path is ok to me too.
@mohammadashrafuddinferdous9347
@mohammadashrafuddinferdous9347 Жыл бұрын
@@saaslaravel I like you super simple dto btw.
@carvalho1990
@carvalho1990 Жыл бұрын
Is there a repo for this code? Amazing! thanks!
@saaslaravel
@saaslaravel Жыл бұрын
Unfortunately not, that's a private project
@karlson2804
@karlson2804 Жыл бұрын
Very, very cool format, if possible, shoot more, please.
@_bijaydas
@_bijaydas Жыл бұрын
I see you have a few Enums. What is preferred storing statuses for products, users etc. in Enums or in a table? I used to use Enums but now converted all status to status table.
@saaslaravel
@saaslaravel Жыл бұрын
I use enums that cast to an int and just save the int in the db. This way I have nice type hinting in the app layer and can add more enums without having to alter db
@SilverPaladin
@SilverPaladin Жыл бұрын
@@saaslaravel I saw your Enum approach in another video and I love it! I hate having to touch the db to add or change the enums! I guess we could also add a layer on top of that for different languages?
@akhileshkumar-iu9uq
@akhileshkumar-iu9uq 9 ай бұрын
Can u name the vscode extension which make ur code very real
@GergelyCsermely
@GergelyCsermely Жыл бұрын
Thanks
@Nodsaibot
@Nodsaibot Жыл бұрын
ANY php project that it requires use of the CLI means you are doing things WRONG, PHP was not created for this use environment
@SunilYadav-tm6kt
@SunilYadav-tm6kt Жыл бұрын
Not at all, its depends on requirement and use case
@khanra17
@khanra17 3 ай бұрын
Why TF you decreased the pitch soo much ? these annoying youtubers, never gonna learn
@saaslaravel
@saaslaravel 3 ай бұрын
That's how my voice sounds bud, it's just noice reduction + VO EQ, enjoy your day!
@jakubn3565
@jakubn3565 3 ай бұрын
Agreed
@khanra17
@khanra17 2 ай бұрын
​@@saaslaravel No it's not. You never know your voice! Record someone you speak to in real life. Apply the same processing. And realize how far you are from a "human voice".
Laravel + Service Pattern + DTOs = ❤️❤️❤️
17:52
Przemysław Przyłucki
Рет қаралды 54 М.
Laravel Controller: Move Logic to Action or Service Class
10:06
Laravel Daily
Рет қаралды 37 М.
БОЙКАЛАР| bayGUYS | 27 шығарылым
28:49
bayGUYS
Рет қаралды 1,1 МЛН
«Жат бауыр» телехикаясы І 26-бөлім
52:18
Qazaqstan TV / Қазақстан Ұлттық Арнасы
Рет қаралды 434 М.
Laravel: Repository Pattern in practice
27:13
Przemysław Przyłucki
Рет қаралды 12 М.
Factory Design Pattern in Laravel and PHP
16:18
EscoTech
Рет қаралды 8 М.
Laravel app can't possibly be THIS good... [Free course: Great Laravel Apps #2]
34:44
Async Transform Streams - Part 1 - Sane C++ Libraries [ep.32]
1:07:20
Stefano Cristiano
Рет қаралды 86
Testing has never been THIS EASY [Free course: Great Laravel Apps #3]
22:47
Przemysław Przyłucki
Рет қаралды 2,8 М.
PHP is the future
34:27
Aaron Francis
Рет қаралды 183 М.
Laravel SaaS Idea: Mockup Generator
41:00
Przemysław Przyłucki
Рет қаралды 1,8 М.
Laravel: Create Public API with Cache and Rate Limits
12:18
Laravel Daily
Рет қаралды 46 М.
Laravel Pipelines: Build an Api
8:54
Jordan Dalton
Рет қаралды 25 М.