mmartin_joo Profile Banner
Martin Joo Profile
Martin Joo

@mmartin_joo

Followers
18K
Following
4K
Media
2K
Statuses
6K

building the search engine for engineering teams https://t.co/mvr2y27lfs

Laravel DDD book 👉
Joined November 2021
Don't wanna be here? Send us removal request.
@mmartin_joo
Martin Joo
1 month
launch day🔥 released my new book System Design with Laravel - 267 pages of high-quality content - system design from scratch - designing real-world systems - planning different projects - databases, caching - ...and more grab your copy now
13
34
270
@mmartin_joo
Martin Joo
2 days
still the best code analysis tool out there
7
9
210
@Tesla
Tesla
6 days
Teslas have the lowest maintenance & repair costs of any brand
0
442
3K
@mmartin_joo
Martin Joo
3 days
by the way we're building Horizontal. the best search platform for your team that will give you pure joy not PTSD https://t.co/iwYYu8BFy6
1
0
2
@mmartin_joo
Martin Joo
3 days
if tech products were honest slack
2
0
8
@mmartin_joo
Martin Joo
3 days
If you have any Laravel or development-related questions, just drop a DM! I'd be happy to help if I can.
0
0
1
@mmartin_joo
Martin Joo
3 days
There's an official Laravel package called pail. It's a log-tailing package that provides real-time log monitoring directly from Artisan. Very nice👌
5
1
58
@mmartin_joo
Martin Joo
4 days
14/14 Thank you if you're still here! If you're experiencing challenges while designing new systems or complicated features, my team and I can help you. Just drop a DM and let's talk!
1
0
3
@mmartin_joo
Martin Joo
4 days
13/14 That’s it! We have our "mini application" inside our app that handles a specific 3rd party. Nice and easy.
1
0
4
@mmartin_joo
Martin Joo
4 days
12/14 These requests can be used pretty easily:
1
0
2
@mmartin_joo
Martin Joo
4 days
11/14 In the parent GumroadService we can configure the access token:
1
0
2
@mmartin_joo
Martin Joo
4 days
10/14 To make our lives even easier, we can use a package to handle requests. Saloon is a great one, but in this example, I'm using laravel-transporter. With this package, the GetProductRequest looks like this:
2
0
1
@mmartin_joo
Martin Joo
4 days
9/14 But now we have to use every request separately. Which is fine, but not so convenient, so we can use these requests in the GumroadService:
1
0
2
@mmartin_joo
Martin Joo
4 days
8/14 Each request class implements one API endpoint:
1
0
2
@mmartin_joo
Martin Joo
4 days
7/14 If you think about it, these methods, such as the `product()`, are requests. Why don’t we treat them as if they were form requests? Let’s put ‘em in separate classes:
1
0
2
@mmartin_joo
Martin Joo
4 days
6/14 With this approach, we have one class for the whole API, and each endpoint has a method. This is perfectly fine and works 99% of the time. However, there are some situations when the API is simply too big to put everything in one class.
1
0
1
@mmartin_joo
Martin Joo
4 days
5/14 Now everything is ready to actually implement the GumroadService class:
1
0
3
@mmartin_joo
Martin Joo
4 days
4/14 Each service can have its own service provider. This is the perfect opportunity to use Laravel’s singleton bindings. We can create a new instance using the configuration values:
1
0
3
@mmartin_joo
Martin Joo
4 days
3/14 In Laravel, we have the services.php config file. This is the perfect place to configure our 3rd parties:
1
0
3
@mmartin_joo
Martin Joo
4 days
2/14 In the Services folder, I create a new folder for each 3rd party and treat it like it were a mini-application inside my app. It looks like this:
1
0
4
@mmartin_joo
Martin Joo
4 days
1/14 Treat your 3rd parties as if they were mini-applications inside your application. They have their own namespaces, DTOs, service classes, and so on. Something like this:
1
0
2
@mmartin_joo
Martin Joo
4 days
💡 How to integrate 3rd parties into your application? We must integrate with many 3rd party APIs and SDKs in every project. You can treat them as mini-applications inside your app. 🧵Keep Reading
6
16
141