Martin Joo Profile picture
Jan 7, 2022 12 tweets 5 min read Read on X
Here are my top 10 #Laravel packages📦

I would immediately DIE without them!

🧵Keep reading
1/11 laravel-query-builder by @spatie_be

With this package, you can build Eloquent queries based on the Request. It can handle things like:

- Filtering
- Sorting
- Including relationships
- Sparse fieldsets
2/11 has-many-deep by @staudenmeir

With this package, you can query deep relationships with a single SQL query.

Consider these relationships:
Country → has many → User → has many → Post → has many → Comment
3/11 Pest by @nunomaduro

The elegant testing framework inspired by Jest from the JS world:
4/11 Blueprint by @gonedark

With this package, you can define your models in a YAML file and it will generate:

- Migrations
- Models with relationships
- Factories
- CRUD Controllers
- Routes
- Form requests
- Even Jobs, Mails, Events, or basic HTTP tests
5/11 Clockwork by itsgoingd

Debugbar on steroids. You can monitor:

- Requests
- Performance metrics
- Log entries
- DB queries
- Cache queries
- Redis commands
- Events, jobs
- ...and more
6/11 json-api by @timacdonald87

A package that implements the JSON API standard and makes your life easy.

This is how a JsonApiResource looks like:
7/11 ziggy @TightenCo

This package makes it possible to use your Laravel named routes from your Javascript. Only applies to full-stack or MVC Laravel apps (no SPA).

Very useful!
8/11 laravel-auditing by owen-it

With this package, you can audit every change in your models. You only need to add a single Trait to your models, and you get every change recorded!
9/11 laravel-excel by @SpartnerNL

If you work with Excel exports this package is a must-have! This is how a simple user export looks like:
10/11 laravel-ide-helper by @barryvdh

The good old IDE helper! This package makes your IDE understand your models and Laravel classes. It gives you very nice autocompletion.
11/11 Thank you if you’re still here!

I post about Laravel every freaking day, so follow @mmartin_joo

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Martin Joo

Martin Joo Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @mmartin_joo

Dec 4
💰 How to handle money in PHP

There are lots of low-quality projects when it comes to dealing with money, numbers, percentages, transactions, and all that financial stuff.

Here are some tips that you can use:
- Value objects
- moneyphp/money
- Model casts

🧵Keep Reading Image
1/9 Cent values

In order to handle money values in a reliable way we need to store them as cent values. Instead of storing $19.99 as 19.99 in the database, we store it as 1999. This way we'll have no problem with decimal points, rounding, multiplying, or dividing numbers.
2/9 Value objects

The other thing we can do is to use value objects instead of treating them as float numbers in PHP. So instead of this: Image
Read 10 tweets
Nov 30
🔥 Here are some of the most basic monitoring techniques you can start using immediately:
- Spatie laravel-health
- Error tracking
- Syntethic checks

It takes ~30 minutes to set up these.

🧵 Keep Reading Image
Health checks with laravel-health

The package can check:
- CPU load
- Disk space utilization
- Database connectivity
- Redis
- And even query speed Image
The example contains pre-built checks. For instance, it notifies you if the average CPU load is higher than 2.5 in the last 5 minutes or 2 in the previous 15 minutes.

It also notifies you if the used disk space is more than 70% Image
Read 9 tweets
Nov 28
Here are my favorite 22 Laravel packages📦

I would immediately DIE without them!

🧵Keep Reading
1/ laravel-excel

The single best package to handle Excel exports and imports:

- Exporting collections
- Storing files
- Exporting from a query
- Queue jobs
- And more Image
2/ laravel-health

This amazing Spatie package can monitor the health of your application and server. It sends you notifications if something's wrong. For example:
- CPU load
- Used disk space
- Database connections
- Redis
- and more Image
Read 24 tweets
Nov 27
🔥 Most applications need to export and import large amounts of data.

It is very easy to:
- Waste lots of memory
- Perform hundreds or thousands of unnecessary DB queries

You can avoid them by learning some pretty simple techniques.

🧵 Keep Reading Image
1/

When it comes to working with larger datasets one of the best you can apply to any problem is chunking. Divide the dataset into smaller chunks and process them. It comes in many different forms.
2/ Let's start with a simple CSV or XLS export since it's a common feature in many applications. laravel-excel is a pretty good package that you can use.

Here's a basic export: Image
Read 11 tweets
Mar 12
🛠️ How to measure performance in Laravel

There are some pretty simple tools you can start measuring your app's performance with:
- ab
- jmeter
- Inspector
- Telescope

🧵 Keep Reading Image
1/14 Here are some of the most important measures of an API/backend service:
- Throughput: the number of requests the system can handle
- Load time: the amount of time it takes for an HTTP request to respond
- Size: the total size of the HTTP response.
2/14 ...measures of an API/backend service

- Server uptime: the duration of time the server is up and running
- CPU usage: the amount of CPU your system needs to run. It is usually expressed as load average
- Memory usage: the amount of memory your system uses
Read 15 tweets
Nov 24, 2023
💡How to integrate 3rd parties into your application?

We have to integrate with a ton of 3rd party APIs, and SDKs in every project. You can treat them as mini-applications inside your app.

🧵Keep Reading Image
1/14

Treat your 3rd parties as if they were mini-applications inside your application. They have their own namespaces with their own DTOs service classes and so on. Something like this: Image
2/14

In the Services folder, I create a new folder for each 3rd party and treat it like it is a mini-application inside my app.

It looks like this: Image
Read 15 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(