« 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.
laravel-excel
The single best package to handle Excel exports and imports:
- Exporting collections
- Storing files
- Exporting from query
- Queue jobs
- And more
blueprint
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
laravel-data
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
phpinsights
This is my favorite static analysis tool. It scores your code base and gives you this beautiful page in terminal:
laravel-query-builder
With this package, you can build Eloquent queries based on the Request. It can handle things like:
- Filtering
- Sorting
- Including relationships
- Sparse fieldsets
If you're interested in this package, make sure you understand Laravel custom query builders first.
larastan
It’s a pretty great static analysis tool on top of phpstan that integrates well with Laravel:
has-many-deep
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:
deptrac
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:
pest
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.
clockwork
Debugbar on steroids. You can monitor:
- Requests
- Performance metrics
- Log entries
- DB queries
- Cache queries
- Redis commands
- Events, jobs
- ...and more
json-api
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.
ziggy
This package makes it possible to use your Laravel named routes from your Javascript. It can be a Blade, an Inertia, or even a SPA application.
Pretty useful!
laravel-activitylog
A very convenient audit log package. It will log every activity in your application:
laravel-ide-helper
The good old IDE helper! This package makes your IDE understand your models and Laravel classes. It gives you very nice autocompletion.
laravel-transporter
If you’re working with 3rd party APIs and services, you ABSOLUTELY need this package!
request-factories
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:
laravel-backup
Another package from Spatie. With this one, your whole backup process should look like this:
php artisan backup:run
terminal
If you’re working with terminal commands you can use Symfony Process which is a pretty good component. Terminal takes it to another level:
laravel-nestedset
Let’s be honest… We all hate hierarchical data structures and trees. Fortunately, this package saves us:
accountant
Another pretty impressive auditing and accountability package: