Laravel Best Practices: How to Automate Your Routine
You’re a Laravel developer, a web artisan. You want to be more productive, right? In this blog post, you’ll learn how to increase your productivity using PhpStorm with the Laravel Idea plugin.
One crucial feature that boosts the productivity of Laravel developers is autocompletion for the actions they use on a daily basis. With a deep understanding of your Laravel codebase, PhpStorm bundled with the Laravel Idea plugin supports autocompletion of the most frequently used commands. Let’s take a look at each of them.
Laravel does quite a lot to make Eloquent such a powerful ORM, and PhpStorm is able to understand everything thanks to the Laravel Idea plugin. The benefits range from autocompletion on methods like scopes, to PhpStorm knowing about all available model fields and relations, to full query builder and factory support, and much more.
The bundle provides autocompletion and insights into routes everywhere. You’ll get autocompletion on route names and route methods.
Livewire, the library that drastically simplifies dynamic interfaces, is also supported. You’ll get autocompletion on methods and properties, you can easily switch between view and component files, you can click on components, and much more.
PhpStorm combined with the Laravel Idea plugin supports request classes and validation rules, adding a bunch of autocompletions and insights wherever you need them. You can also generate default request rules based on models.
Laravel Idea has support for generating almost anything. From controllers and middleware to migrations and console commands, it’s all there. You don’t have to remember “make” commands and their parameters. Laravel Idea provides a clean interface to generate everything you need.
Syntax Highlighting in Blade
PhpStorm already offers powerful syntax highlighting for different constructs and syntax errors right out of the box. For Laravel artisans, we added Blade support via Laravel’s template engine.
You can extract code to blade components, and there’s autocompletion for those components. In addition, you can refactor a Blade file name and automatically update all its references. You can even create Blade files from within controllers, have autocompletion within those blade files, and much more.
Automated adjusting of namespaces and imports
Apart from autocompletion and highlighting, PhpStorm has a range of powerful features related to automatically adjusting namespaces and imports.
When you move a file, PhpStorm adjusts its namespace and all imports automatically. When referencing any class, PhpStorm will add imports for it. PhpStorm does a lot of boring work for you with its refactoring capabilities, such as renaming variables or extracting code into separate methods, as well as offering error detection, code generation, formatting assistance, and more.
Frontend framework support
PhpStorm also has built-in support for popular frontend frameworks like Tailwind, Vue, React, and many others.
Here are some of the tools that are built into PhpStorm out of the box: our GIT integration (including GitHub support), our HTTP client, a debugger, and database tools, just to name a few.
New Laravel course by Jeffrey Way
Want to take a closer look at what the PhpStorm and Laravel Idea bundle has to offer? Take this free online course on Laracasts and learn how to:
- Enhance your Laravel development by coding in PhpStorm with the Laravel Idea plugin.
- Refactor, debug, and test your code using PestPHP.
- Write better code and be more productive with Laravel.
And that’s not all! Now you can enjoy the Laravel Idea plugin with a special 50% discount. Claim the offer here.
Subscribe to Blog updates
Thanks, we've got you!
How the Pest PhpStorm Plugin Will Improve Your Testing Workflow
Perhaps you’ve already heard of Pest. It is a new PHP testing framework with a focus on simplicity. The Pest PhpStorm plugin is a new addition to PhpStorm’s growing ecosystem. With this plugin, testing your code in your favorite IDE is even simpler and faster! The source code behind the plugin is…
HTTP Client in PhpStorm Overview
When developing a web service, you would usually test it by sending all kinds of HTTP requests to it and examining what’s returned. In PhpStorm, you can do this directly in the code editor. In this post, we’ll use the github.com/JetBrains/phpstorm-http-client-tutorial example project to demonstra…
Quickstart with Docker in PhpStorm
So, you’ve decided to try something new today and started a project from scratch. Your first step will be to set up a development environment: at the bare minimum, you’d want to run a web server and a PHP interpreter (preferably – with the debugging engine installed). With Docker, you can star…
Install PhpStorm with Snaps
Exciting news for Linux users: you can now use snaps to install PhpStorm builds. Snaps will update your app automatically, and you’ll always have a fresh PhpStorm build right out of the oven. Snaps are really easy to install and use. On Ubuntu 16.04 LTS or later, snaps come pre-installed. On other L…