This package integrates the php artisan make:*
commands to the "File > New" menu.
Once an action, say File > New > Laravel > Controller is triggered, a dialog pops up, where you can enter the
name of the class to be generated. Once you hit enter, the artisan command, here
php artisan make:controller
, will be executed by your configured php
interpreter.
A more detailed description can be is located in the project readme on GitHub
The plugin tries to be helpful, by highlighting appropriate actions, based on where in your project you
triggered the action. If you right-click click on the "app/Http" folder, only Controller
,
Middleware
, Resource
and Request
would be active, so you are not getting overwhelmed by all the
other make-commands available.
Note: You can always trigger the actions from anywhere by using the double-shift/search anything menu and search for the action. In this case, nothing will be filtered out based on your selection in the Project-view.
It also pre-fills the namespace for the class to be generated. If you try to generate a new
Controller
in a A/Deeply/Nested/Namespace/In/Your/Controllers/Folder
, the input will already be pre-filled with the right
namespace, as you can see in the image below. Now the artisan command to be executed will contain the namespace,
so your new class will also be created in the app/Http/Controllers/A/Deeply/Nested/Namespace/In/Your/Controllers/Folder
.
You can pass every flag that is supported by the artisan sub-command of your choice. Just write all flags after the name of the class you want to generate, and they will be passed along.
If you are using Docker to run your local development environment, and you have specified path mappings for your project PHP interpreter, everything will just work fine (just make sure you have your path mappings setup). The extension uses the interpreter specified in the project settings, or the first local one it can find, if none is configured.
Because the IDE has to launch a Docker container in the background, which takes some time, you will see a popup like the one below, if you are using a remote interpreter.
- Cast
- Channel
- Command
- Component
- Controller
- Event
- Exception
- Factory
- Job
- Listener
- Middleware
- Migration
- Model
- Notification
- Observer
- Policy
- Provider
- Request
- Resource
- Rule
- Seeder
-
Using IDE built-in plugin system:
Preferences > Plugins > Marketplace > Search for "jetbrains-laravel-make-integration" > Install Plugin
-
Manually:
Download the latest release and install it manually using Preferences > Plugins > ⚙️ > Install plugin from disk...
This does only work if you have the Laravel project open, the root of your project is the root of your Laravel folder and contains the artisan binary!
If you have an idea for improving this plugin, first take a look at the existing feature requests and then submit an issue through Github.