
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
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
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
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
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
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
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
11/14 In the parent GumroadService we can configure the access token:
1
0
2
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
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
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
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
5/14 Now everything is ready to actually implement the GumroadService class:
1
0
3
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
3/14 In Laravel, we have the services.php config file. This is the perfect place to configure our 3rd parties:
1
0
3
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
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
💡 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