By @aaronsaray · 2021-10-21 20:30 (edited)
What tools can you not live without for your Laravel projects? Whether they're dev-based or packages that you always have in your projects.
I'll start it out with my lists
Laravel IDE Helper - this writes some files to your project to help your PHPStorm, VSCode or other IDE do a lot of awesome autocompletion. In addition, I use it to --write
to my models so I have autocompletion of all their properties and relationship collections.
League CSV The best, most predictable CSV parsing tool I've ever used.
Laravel Auditing Awesome package for standard Laravel and eloquent auditing. Can be extended to audit other things like actions that have happened in your app.
Laravel Permissions Spatie - the king of Laravel packages - made the Roles/Permissions access package that I love. I will even use permissions as a form of feature flag when I don't need anything huge or involved.
Roave/SecurityAdvisories The simplest way to help protect yourself from installing vulnerable packages.
PHP_CodeSniffer My preferred code standard tool in PHP.
slevomat/coding-standard Additional rules for PHP_CodeSniffer that I like to introduce.
There are tons more - let the community know what you love and can't live without in your project.
By @samuel · 2021-10-25 12:24
I personally don't use IDE helper. Cannot really explain why, but I don't like it much.
I find that I only have two issues with IDE support in my VSCode with Intelephense.
First one is auth()->user()
not returning the application's User
model. For that I create a custom user()
helper typically.
Second one is model properties. I like writing my own /**@ property */
annotations above models, because it's also how I often start developing the database layer. I only write migrations after that.
I think IDE helper solves some facade issues as well, but I never use aliases and always import them fully, and if possible I use global helpers like cache()
.
Other than that, I always use Pest for testing, and larastan in all of my packages. Now I also started using those in my Laravel projects.
For CS, I use php-cs-fixer with my own config.
All of these things can be found in our package template — https://github.com/archtechx/template.
The template also has a neat ./check
script which runs these checks and shows nice output. Very cool for local package development.
By @mike · 2021-10-25 11:37
I'd recommend Laravel Accountant over Auditing if you'd like integrity checks out of the box. Also seems like a better implementation overall.
For roles and permissions, I use Bouncer due to its broad feature set and approach to dealing with ACL.
I also make heavy use of League’s pipeline, and forked it some time back to add some additional functionality. Finding that I use this more and more these days.
And lastly, I use WebSockets quite a bit.
Few others I use, but can live without them. 😉