« back published by @mmartin_joo on October 3, 2022
Top 20 Laravel Packages
I've used a lot of packages throughout the years and in this list I want to show you my all time favorites. They can be a huge help in almost any application.
The single best package to handle Excel exports and imports:
- Exporting collections
- Storing files
- Exporting from query
- Queue jobs
- And more
With this package, you can define your models in a YAML file and it will generate:
- Models with relationships
- CRUD Controllers
- Form requests
- Even Jobs, Mails, Events, or basic HTTP tests
If you’re using Data Transfer Objects or DTOs to handle data in your application, this is a must have:
- DTO as request, response
- Nested DTOs
- Lazy loading properties
- Validation rules
- Easy mapping from requests or models
This is my favorite static analysis tool. It scores your code base and gives you this beautiful page in terminal:
With this package, you can build Eloquent queries based on the Request. It can handle things like:
- Including relationships
- Sparse fieldsets
If you're interested in this package, make sure you understand Laravel custom query builders first.
It’s a pretty great static analysis tool on top of phpstan that integrates well with Laravel:
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
With this relationship you can query every comment to a country in just one query:
You can keep your architecture clean with this static analysis tool. You can define what layer can use what other layers and it will force you to obey these rules.
It can be especially useful in legacy project if want to refactor:
The most amazing PHP testing framework built top on phpunit:
If you're interested in pest and testing in general, check out my book If you're interested in this package, make sure you understand Test-Driven APIs with Laravel and Pest.
Debugbar on steroids. You can monitor:
- Performance metrics
- Log entries
- DB queries
- Cache queries
- Redis commands
- Events, jobs
- ...and more
A package that implements the JSON API standard and makes your life easy.
This is what a JsonApiResource looks like:
If you're not familiar with the JSON API standard, download Proper API Design with Laravel.
A very convenient audit log package. It will log every activity in your application:
The good old IDE helper! This package makes your IDE understand your models and Laravel classes. It gives you very nice autocompletion.
If you’re working with 3rd party APIs and services, you ABSOLUTELY need this package!
If you’re writing a lot of API or feature tests (which you should do, by the way) this package will save you hours when constructing request data:
Another package from Spatie. With this one, your whole backup process should look like this:
php artisan backup:run
If you’re working with terminal commands you can use Symfony Process which is a pretty good component. Terminal takes it to another level:
Let’s be honest… We all hate hierarchical data structures and trees. Fortunately, this package saves us:
Another pretty impressive auditing and accountability package: