Skip to main content
Composer Packages that Every Laravel Developer Must Have

Composer Packages that Every Laravel Developer Must Have

hackernoon.comhackernoon.com2 weeks ago in#Dev Love23

Its rich ecosystem makes Laravel Framework a great choice for PHP development. There are 15+ standalone extensions to the framework that solve common problems of big and complex apps.Some of them are very specific, like Laravel Cashier, which provides an easy Stripe integration for your projects.Some of them are useful to projects of any size and complexity, and some of them allow us to build performant and scaling apps. Those extensions I will describe in this part of the series.I will start with absolute must-haves.I believe developers of middle and senior levels should always use those in their process where you have at least one external data store and/or expose any sort of APIs. Telescope https://laravel.com/docs/9.x/telescope#introduction Telescope homepage Everything that happens in your applications will be recorded and displayed here. This is a useful tool for finding bottlenecks in your apps. If your API response is slow — is it a database problem or a compute problem? What logs did that job call created? What tasks have the scheduler run in the last 5 minutes? All sorts of information can be found here.One hint: add the Telescope trim job right away, to keep debug tables smaller.$schedule-command(‘telescope:prune –hours=48’)-daily();Horizon https://laravel.com/docs/9.x/horizon#introduction Horizon homepage This requires Redis and your project to be a bit bigger than a starter template. Horizon adds asynchronous task processing to your Laravel application. This allows your API/web pages to respond faster while offloading heavy work to Horizon instances.Must have for any async queues processing, for WebSockets integration in your apps.Has a nice feature of metrics to spot slow-running async jobs. Now, we’ll go over developer productivity addons for your Laravel projects.Laravel IDE Helper https://github.com/barryvdh/laravel-ide-helper This will create a helper file to resolve all of your model fields so PhpStorm is aware of them. This will create a helper description file for all of the magic Eloquent methods (resolving methods and auto-completion, parameters hints).Recommended commands:php artisan ide-helper:model –nowritephp artisan ide-helper:meta php artisan ide-helper:generate Add to your .gitingore file.phpstorm.meta.php_ide_helper.php _ide_helper_models.php And some automation — add to your composer.json scriptscomposer.json scriptsEvery time you run composer i or composer update — your models are refreshed.Larastan https://github.com/nunomaduro/larastan A static code analysis tool designed for Laravel projects (under the hood PhpStan is used, so effectively you get both).Add to your composer.json scripts”analyze”: [“vendor/bin/phpstan analyse”] composer.json scriptsNow running the composer analyze command will test your code for any problems.Larastan run resultsThis command can be run during CI/CD cycle to ensure code quality on a project with a distributed team.Pro Tip: you can get PhpStorm to automatically analyze working files and show any errors. We’ll see how this can be configured in the next article.PHP_CodeSniffer https://github.com/squizlabs/PHP_CodeSniffer These tools will help keep your code to a selected standard.  » Read More

Like to keep reading?

This article first appeared on hackernoon.com. If you'd like to continue this story, follow the white rabbit.

View Full Article
Laravel Vs Symfony: Answering All The Questions To Make a Better Choice

Laravel Vs Symfony: Answering All The Questions To Make a Better Choice

#Dev
How to Channel a Daily Vision into a 20-Year Photography Career

How to Channel a Daily Vision into a 20-Year Photography Career

#Silicon Valley
WordPress Punts Locally Hosted Fonts for Legacy Default Themes to 6.2 Release

WordPress Punts Locally Hosted Fonts for Legacy Default Themes to 6.2 Release

#Web Design
Fresh For Designers

Is the Dynamic Island plain stupid or the next revolutionary UX pattern?

#All

Let's talk about Dev