Skip to content

Commit 3e78b16

Browse files
committed
add more default IDEOpener and update readme
1 parent 0ae949f commit 3e78b16

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,22 @@ With `{--git}` option all generated files will be added to git automatically. In
215215

216216
## Open files in IDE
217217

218-
With `{--ide=}` option you can define your preferred IDE to open all automatically generated files. The keys in the `ides`-Array of the config file are possible values for the command option. You can add other IDE-Opener classes, they have to implement `Webfactor\Laravel\Generators\Contracts\OpenInIdeInterface`. This package comes with implementations for PhpStorm (`pstorm`), Sublime (`sublime`) and VS Code (`vscode`).
218+
If specified we will automatically open all generated files in the IDE of your choice.
219+
There are three options to use this feature (applied in tis order):
220+
* `{--ide=}` command option
221+
* __.env__ variable `APP_EDITOR`
222+
* config value `config(app.editor)`
223+
224+
The keys in the `ides`-Array of the config file are possible values for the command option.
225+
Per default we provide:
226+
* `phpstorm`: will open all files with `pstorm` CLI helper of PhpStorm
227+
* `pstorm`: will open all files with `pstorm` CLI helper of PhpStorm
228+
* `sublime`: will open all files with `subl` CLI helper of Sublime
229+
* `subl`: will open all files with `subl` CLI helper of Sublime
230+
* `vscode`: will open all files with `code` CLI helper of VSCode
231+
* `code`: will open all files with `code` CLI helper of VSCode
232+
233+
You can add other IDE-Opener classes. They have to implement `Webfactor\Laravel\Generators\Contracts\OpenInIdeInterface`.
219234

220235
In your service class you have to add the generated file to a stack (see "Add files to git" section)
221236

config/generators.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,28 @@
2525
'phpstorm' => Webfactor\Laravel\Generators\Recipes\PhpStormOpener::class,
2626
'pstorm' => Webfactor\Laravel\Generators\Recipes\PhpStormOpener::class,
2727
'sublime' => Webfactor\Laravel\Generators\Recipes\SublimeOpener::class,
28+
'subl' => Webfactor\Laravel\Generators\Recipes\SublimeOpener::class,
2829
'vscode' => Webfactor\Laravel\Generators\Recipes\VSCodeOpener::class,
30+
'code' => Webfactor\Laravel\Generators\Recipes\VSCodeOpener::class,
2931
],
3032

3133
'naming' => [
32-
'migration' => Webfactor\Laravel\Generators\Schemas\Naming\Migration::class,
33-
'languageFile' => Webfactor\Laravel\Generators\Schemas\Naming\LanguageFile::class,
34-
'crudModel' => Webfactor\Laravel\Generators\Schemas\Naming\CrudModel::class,
35-
'crudRequest' => Webfactor\Laravel\Generators\Schemas\Naming\CrudRequest::class,
34+
'migration' => Webfactor\Laravel\Generators\Schemas\Naming\Migration::class,
35+
'languageFile' => Webfactor\Laravel\Generators\Schemas\Naming\LanguageFile::class,
36+
'crudModel' => Webfactor\Laravel\Generators\Schemas\Naming\CrudModel::class,
37+
'crudRequest' => Webfactor\Laravel\Generators\Schemas\Naming\CrudRequest::class,
3638
'crudController' => Webfactor\Laravel\Generators\Schemas\Naming\CrudController::class,
37-
'routeFile' => Webfactor\Laravel\Generators\Schemas\Naming\RouteFile::class,
38-
'factory' => Webfactor\Laravel\Generators\Schemas\Naming\Factory::class,
39-
'seeder' => Webfactor\Laravel\Generators\Schemas\Naming\Seeder::class,
40-
'sidebar' => Webfactor\Laravel\Generators\Schemas\Naming\Sidebar::class,
39+
'routeFile' => Webfactor\Laravel\Generators\Schemas\Naming\RouteFile::class,
40+
'factory' => Webfactor\Laravel\Generators\Schemas\Naming\Factory::class,
41+
'seeder' => Webfactor\Laravel\Generators\Schemas\Naming\Seeder::class,
42+
'sidebar' => Webfactor\Laravel\Generators\Schemas\Naming\Sidebar::class,
4143
],
4244

4345
'fieldTypes' => [
44-
'date' => \Webfactor\Laravel\Generators\Schemas\FieldTypes\DateType::class,
45-
'number' => \Webfactor\Laravel\Generators\Schemas\FieldTypes\NumberType::class,
46+
'date' => \Webfactor\Laravel\Generators\Schemas\FieldTypes\DateType::class,
47+
'number' => \Webfactor\Laravel\Generators\Schemas\FieldTypes\NumberType::class,
4648
'summernote' => \Webfactor\Laravel\Generators\Schemas\FieldTypes\SummernoteType::class,
47-
'string' => \Webfactor\Laravel\Generators\Schemas\FieldTypes\StringType::class,
48-
'text' => \Webfactor\Laravel\Generators\Schemas\FieldTypes\TextType::class,
49-
]
49+
'string' => \Webfactor\Laravel\Generators\Schemas\FieldTypes\StringType::class,
50+
'text' => \Webfactor\Laravel\Generators\Schemas\FieldTypes\TextType::class,
51+
],
5052
];

0 commit comments

Comments
 (0)