Laravel app can't possibly be THIS good... [Free course: Great Laravel Apps #2]

  Рет қаралды 8,343

Przemysław Przyłucki

Przemysław Przyłucki

Жыл бұрын

Hi there!
In this series video I'll be showing you my preferred version of creating Laravel applications.
I'll walk over the project structure that I absolutely love and cover:
- Creating custom src/Modules/ directory
- Custom Exceptions
- Custom Resources
- Services
- Laravel's Container resolving interfaces
- DTOs
- Custom Query Buiders
- Enums
Resources:
- Laravel's website: laravel.com
- Custom Exceptions Video: • Laravel: The BEST way ...
- Custom Resources Video: • Fixing Laravel's BIGGE...
- Code repo: github.com/saas-laravel/larav...
Course website:
saaslaravel.com/
More about me:
przemyslawprzylucki.com

Пікірлер: 26
@_timestamp
@_timestamp Жыл бұрын
I recognize a high quality youtube channel when i see one. This is one of them.
@nicolascanala9940
@nicolascanala9940 Ай бұрын
Man you would love C# haha. Thanks for the video!
@navod_rashmika
@navod_rashmika Жыл бұрын
It's awesome. do more of these types of videos. all the best.🖤
@thirdvect0r
@thirdvect0r Жыл бұрын
Great vid as always! I definitely need to think more about my error handling, because I often rely on the built in exception types which never gives me the granularity I like without delving into stack traces on sentry :D Couple of personal preferences, absolutely just trying to contribute my ideas here 12:15 - SettingType::from($request->validated('type')) can become $request->enum('type', SettingType::class) which I think has the advantage of being a bit more readable, and lets the caller know than we (probably) already validated for enum safety 25:15 - Instead of passing an anonymous array of SettingDtos, I would like to have my storeMany method have the signature storeMany(User $user, ...Dto $dto). I prefer this because by splatting in the params you can get language level type safety on the arguments instead of relying on the doc block to help -- just call with $service->storeMany($request->user, ...$dtos) and you've got type safety on both sides :)
@saaslaravel
@saaslaravel Жыл бұрын
These are great suggestions! Thank you!
@C0DE8
@C0DE8 4 ай бұрын
Great Tutorial! THX. 👍 One question, what us your PHPStorm Theme? Thanks in advance.🙏
@laksamanasulthanalam.s73
@laksamanasulthanalam.s73 Жыл бұрын
Really Great Content. Do you have any platform other than youtube, for example medium/github, i'd like to see your published project!
@saaslaravel
@saaslaravel Жыл бұрын
Thanks so much! The source code of this project can be found in the description
@mpowerek77
@mpowerek77 Жыл бұрын
Hej, czy mógłbyś zrobić kontynuację kursu CI/CD? Mam z tym aktualnie spory problem. Czy CD jest w ogóle jakkolwiek możliwe w oparciu o github i dockerhub w aplikacji laravel?
@saaslaravel
@saaslaravel Жыл бұрын
Hej, kontynuacja jest w planach :) CD jest możliwe z poziomu GitHub actions
@kenamreemas3295
@kenamreemas3295 Жыл бұрын
hello, can you please make a tutorial on how to integrate laravel cashier please?
@saaslaravel
@saaslaravel Жыл бұрын
Yes! It's on the roadmap
@gazorbpazorbian
@gazorbpazorbian Жыл бұрын
I love your content! I have doubt, why do you like to split your project like that? could you be more specific and maybe get into the details of how companies handle the structure of a project? does the way you structure your project has a name? like a design pattern name?
@saaslaravel
@saaslaravel Жыл бұрын
Thank you! The structure itself is not necessarily a design pattern but the entire approach presented allows you to create a better separation between business language and the application layer. It's def not DDD but it has some benefits of it. It's just a simple service + DTO pattern with things Laravel gives you for separation of concerns i.e resources and query builder classes
@limitlesskode
@limitlesskode Жыл бұрын
This is a really informing video I appreciate your efforts. However do you need DTOs when you can just use laravel models?
@saaslaravel
@saaslaravel Жыл бұрын
Thank you! The purpose of DTOs is to move data from controller/command/job/external api to the service in unified way. Model doesn't exist at that point yet
@rGxDale
@rGxDale Жыл бұрын
Passing a user model into a module?
@saaslaravel
@saaslaravel Жыл бұрын
User is usually an actor in that arrangement b/c they perform an action. But when you have like a PostService, you'd need two methods. public function store(User $actor, PostDto $dto): Post; public function update(User $actor, Post $post, PostDto $dto): Post; There is nothing wrong with passing models there. It's just the purpose of DTO is to move data and the persistence of that data would happen in the service or repository based on your liking
@rGxDale
@rGxDale Жыл бұрын
@@saaslaravel why pass the model in at all? Surly the setting table only needs a user_id for the scope to apply correctly. And now, without a model, it has no knowledge of the entirety of the user model. And the setting module doesn’t depend on the User /auth module. Ie the setting module should not be calling any methods on $user. Ie $user->changeName(‘hdhdh. Yes this causes you to have to use events to propagate other scope to settings and is a hole other subject but. But what could you need from $user? If you cant be bothered to take a user id from the user variable, would ot not be better for the module to take a Authentication Contact that user implements?
@rGxDale
@rGxDale Жыл бұрын
Yes you should pass a dto, or at least an interface. Only when the model is of another bounded context. There are two distinct types of service, domain and application. An application service uses the domain. Application services are mostly used when handling application level things. Integration events between bounded contexts. Domain services do things that don’t fit into a model. Things in the domain, but not exclusive to an individual entity of that domain. I can provide blog post? For code review if wish
@Novia5555
@Novia5555 8 ай бұрын
What code editor is that?
@saaslaravel
@saaslaravel 8 ай бұрын
It's PHP storm with Catpuccin theme
@mori181186
@mori181186 10 ай бұрын
"Great Laravel Apps" is not your code. Great means how perform your applications in production. Speed, How many Users uses your application..etc.. I think videos like this, tell nothing. There are so many ways to build good code. This is why i dont watch videos in this format. But i like your other videos ;)
@saaslaravel
@saaslaravel 10 ай бұрын
I agree, but cannot really name the video "one of the good ways to make quality code". It gotta be a hot take and my opinion >>> your opinion 😹
@takielias
@takielias 9 ай бұрын
@saaslaravel I can't find the code repo. Could you please check?
@saaslaravel
@saaslaravel 9 ай бұрын
Updated the description!
Laravel + Service Pattern + DTOs = ❤️❤️❤️
17:52
Przemysław Przyłucki
Рет қаралды 44 М.
Are VALUE OBJECTS secretly overpowered?!
13:44
Przemysław Przyłucki
Рет қаралды 3,3 М.
تجربة أغرب توصيلة شحن ضد القطع تماما
00:56
صدام العزي
Рет қаралды 47 МЛН
100❤️
00:19
MY💝No War🤝
Рет қаралды 21 МЛН
Why is Laravel NOT used in Big Development Projects?
11:53
Stefan Mischook
Рет қаралды 172 М.
Real Time Chat With Laravel Reverb
49:22
Tuto1902
Рет қаралды 12 М.
Automated Refactoring With Rector
7:51
php[architect]
Рет қаралды 1,9 М.
A Practical Example How To Use Interfaces In Golang
14:42
Anthony GG
Рет қаралды 20 М.
Laravel: 1,000,000 webhooks/minute?! Ingest webhooks like a PRO
20:51
Przemysław Przyłucki
Рет қаралды 4,2 М.
Laravel: Repository Pattern in practice
27:13
Przemysław Przyłucki
Рет қаралды 10 М.
Why most Laravel projects fail to deliver value
9:04
Sylvain Reiter - The UX CTO
Рет қаралды 812
The Laravel Ecosystem - Livewire 🐙
7:07
Laravel
Рет қаралды 7 М.
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,7 МЛН
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 8 МЛН
Tag her 🤭💞 #miniphone #smartphone #iphone #samsung #fyp
0:11
Pockify™
Рет қаралды 44 МЛН
АЙФОН 20 С ФУНКЦИЕЙ ВИДЕНИЯ ОГНЯ
0:59
КиноХост
Рет қаралды 96 М.
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 2 МЛН
После ввода кода - протирайте панель
0:18
Up Your Brains
Рет қаралды 1,2 МЛН