├── .gitignore ├── LICENCE.md ├── Plugin.php ├── README.md ├── assets └── images │ └── marketplace │ ├── icon.png │ ├── screenshot-1.png │ └── screenshot-2.png ├── composer.json ├── config └── config.php └── updates ├── initial_gen.php └── version.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | 3 | # IDE settings 4 | .idea -------------------------------------------------------------------------------- /LICENCE.md: -------------------------------------------------------------------------------- 1 | # MIT license 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /Plugin.php: -------------------------------------------------------------------------------- 1 | 'IdeHelper', 23 | 'description' => 'Make development easier with IDE helpers!', 24 | 'author' => 'Flynsarmy', 25 | 'icon' => 'icon-code', 26 | 'homepage' => 'https://github.com/Flynsarmy/oc-idehelper-plugin', 27 | ]; 28 | } 29 | 30 | public function boot() 31 | { 32 | Config::set('ide-helper', Config::get('flynsarmy.idehelper::config')); 33 | App::register('\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IDE Helpers 2 | 3 | This plugin adds [barryvdh/ide-helpers](https://github.com/barryvdh/laravel-ide-helper) package to October for better IDE support. 4 | 5 | ## Installation 6 | 7 | * `git clone` into */plugins/flynsarmy/idehelper* 8 | * `composer install` 9 | * `php artisan ide-helper:generate` 10 | 11 | ## Configuration 12 | 13 | No configuration is necessary, but for use of `php artisan ide-helper:models` you may need to edit `/config/config.php` to include the model files you wish to be scanned. 14 | 15 | ## TODO 16 | 17 | * Auto clear-compiled/generate/optimize after update 18 | -------------------------------------------------------------------------------- /assets/images/marketplace/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flynsarmy/oc-idehelper-plugin/0c9ea1359016c54a25e48f65757d557a4730a5ee/assets/images/marketplace/icon.png -------------------------------------------------------------------------------- /assets/images/marketplace/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flynsarmy/oc-idehelper-plugin/0c9ea1359016c54a25e48f65757d557a4730a5ee/assets/images/marketplace/screenshot-1.png -------------------------------------------------------------------------------- /assets/images/marketplace/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flynsarmy/oc-idehelper-plugin/0c9ea1359016c54a25e48f65757d557a4730a5ee/assets/images/marketplace/screenshot-2.png -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flynsarmy/oc-idehelper-plugin", 3 | "type": "october-plugin", 4 | "description": "OctoberCMS plugin to make development easier by providing IDE helpers", 5 | "homepage": "https://github.com/Flynsarmy/oc-idehelper-plugin", 6 | "keywords": ["october", "octobercms", "laravel", "ide", "helper", "vscode", "phpstorm", "php"], 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Flynsarmy", 11 | "homepage": "https://www.flynsarmy.com/" 12 | } 13 | ], 14 | "require": { 15 | "composer/installers": "~1.0", 16 | "barryvdh/laravel-ide-helper": "^2.7.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /config/config.php: -------------------------------------------------------------------------------- 1 | '_ide_helper', 14 | 'format' => 'php', 15 | 16 | /* 17 | |-------------------------------------------------------------------------- 18 | | Where to write the PhpStorm specific meta file 19 | |-------------------------------------------------------------------------- 20 | | 21 | | PhpStorm also supports the directory `.phpstorm.meta.php/` with arbitrary 22 | | files in it, should you need additional files for your project; e.g. 23 | | `.phpstorm.meta.php/laravel_ide_Helper.php'. 24 | | 25 | */ 26 | 27 | 'meta_filename' => '.phpstorm.meta.php', 28 | 29 | /* 30 | |-------------------------------------------------------------------------- 31 | | Fluent helpers 32 | |-------------------------------------------------------------------------- 33 | | 34 | | Set to true to generate commonly used Fluent methods 35 | | 36 | */ 37 | 38 | 'include_fluent' => false, 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Factory Builders 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Set to true to generate factory generators for better factory() 46 | | method auto-completion. 47 | | 48 | */ 49 | 50 | 'include_factory_builders' => false, 51 | 52 | /* 53 | |-------------------------------------------------------------------------- 54 | | Write Model Magic methods 55 | |-------------------------------------------------------------------------- 56 | | 57 | | Set to false to disable write magic methods of model 58 | | 59 | */ 60 | 61 | 'write_model_magic_where' => true, 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | Write Model relation count properties 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Set to false to disable writing of relation count properties to model DocBlocks. 69 | | 70 | */ 71 | 72 | 'write_model_relation_count_properties' => false, 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Write Eloquent Model Mixins 77 | |-------------------------------------------------------------------------- 78 | | 79 | | This will add the necessary DocBlock mixins to the model class 80 | | contained in the Laravel Framework. This helps the IDE with 81 | | auto-completion. 82 | | 83 | | Please be aware that this setting changes a file within the /vendor directory. 84 | | 85 | */ 86 | 87 | 'write_eloquent_model_mixins' => false, 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | Helper files to include 92 | |-------------------------------------------------------------------------- 93 | | 94 | | Include helper files. By default not included, but can be toggled with the 95 | | -- helpers (-H) option. Extra helper files can be included. 96 | | 97 | */ 98 | 99 | 'include_helpers' => false, 100 | 101 | 'helper_files' => [ 102 | base_path().'/vendor/october/rain/src/Support/helpers.php', 103 | base_path().'/vendor/laravel/framework/src/Illuminate/Support/helpers.php', 104 | ], 105 | 106 | /* 107 | |-------------------------------------------------------------------------- 108 | | Model locations to include 109 | |-------------------------------------------------------------------------- 110 | | 111 | | Define in which directories the ide-helper:models command should look 112 | | for models. 113 | | 114 | */ 115 | 116 | 'model_locations' => array_map(function ($filepath) { 117 | return substr($filepath, strlen(base_path()) + 1); 118 | }, array_merge( 119 | glob(base_path().'/modules/*/models'), 120 | glob(base_path().'/plugins/*/*/models') 121 | )), 122 | 123 | /* 124 | |-------------------------------------------------------------------------- 125 | | Models to ignore 126 | |-------------------------------------------------------------------------- 127 | | 128 | | Define which models should be ignored. 129 | | 130 | */ 131 | 132 | 'ignored_models' => [ 133 | ], 134 | 135 | /* 136 | |-------------------------------------------------------------------------- 137 | | Extra classes 138 | |-------------------------------------------------------------------------- 139 | | 140 | | These implementations are not really extended, but called with magic functions 141 | | 142 | */ 143 | 144 | 'extra' => [ 145 | 'Eloquent' => ['October\Rain\Database\Builder', 'October\Rain\Database\QueryBuilder'], 146 | 'Session' => ['Illuminate\Session\Store'], 147 | ], 148 | 'magic' => [ 149 | 'Log' => [ 150 | 'debug' => 'Monolog\Logger::addDebug', 151 | 'info' => 'Monolog\Logger::addInfo', 152 | 'notice' => 'Monolog\Logger::addNotice', 153 | 'warning' => 'Monolog\Logger::addWarning', 154 | 'error' => 'Monolog\Logger::addError', 155 | 'critical' => 'Monolog\Logger::addCritical', 156 | 'alert' => 'Monolog\Logger::addAlert', 157 | 'emergency' => 'Monolog\Logger::addEmergency', 158 | ], 159 | ], 160 | 161 | /* 162 | |-------------------------------------------------------------------------- 163 | | Interface implementations 164 | |-------------------------------------------------------------------------- 165 | | 166 | | These interfaces will be replaced with the implementing class. Some interfaces 167 | | are detected by the helpers, others can be listed below. 168 | | 169 | */ 170 | 171 | 'interfaces' => [ 172 | '\Illuminate\Contracts\Auth\Authenticatable' => config('auth.model', 'App\User'), 173 | ], 174 | 175 | /* 176 | |-------------------------------------------------------------------------- 177 | | Support for custom DB types 178 | |-------------------------------------------------------------------------- 179 | | 180 | | This setting allow you to map any custom database type (that you may have 181 | | created using CREATE TYPE statement or imported using database plugin 182 | | / extension to a Doctrine type. 183 | | 184 | | Each key in this array is a name of the Doctrine2 DBAL Platform. Currently valid names are: 185 | | 'postgresql', 'db2', 'drizzle', 'mysql', 'oracle', 'sqlanywhere', 'sqlite', 'mssql' 186 | | 187 | | This name is returned by getName() method of the specific Doctrine/DBAL/Platforms/AbstractPlatform descendant 188 | | 189 | | The value of the array is an array of type mappings. Key is the name of the custom type, 190 | | (for example, "jsonb" from Postgres 9.4) and the value is the name of the corresponding Doctrine2 type (in 191 | | our case it is 'json_array'. Doctrine types are listed here: 192 | | http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html 193 | | 194 | | So to support jsonb in your models when working with Postgres, just add the following entry to the array below: 195 | | 196 | | "postgresql" => array( 197 | | "jsonb" => "json_array", 198 | | ), 199 | | 200 | */ 201 | 202 | 'custom_db_types' => [ 203 | ], 204 | 205 | /* 206 | |-------------------------------------------------------------------------- 207 | | Support for camel cased models 208 | |-------------------------------------------------------------------------- 209 | | 210 | | There are some Laravel packages (such as Eloquence) that allow for accessing 211 | | Eloquent model properties via camel case, instead of snake case. 212 | | 213 | | Enabling this option will support these packages by saving all model 214 | | properties as camel case, instead of snake case. 215 | | 216 | | For example, normally you would see this: 217 | | 218 | | * @property \Illuminate\Support\Carbon $created_at 219 | | * @property \Illuminate\Support\Carbon $updated_at 220 | | 221 | | With this enabled, the properties will be this: 222 | | 223 | | * @property \Illuminate\Support\Carbon $createdAt 224 | | * @property \Illuminate\Support\Carbon $updatedAt 225 | | 226 | | Note, it is currently an all-or-nothing option. 227 | | 228 | */ 229 | 230 | 'model_camel_case_properties' => false, 231 | 232 | /* 233 | |-------------------------------------------------------------------------- 234 | | Property Casts 235 | |-------------------------------------------------------------------------- 236 | | 237 | | Cast the given "real type" to the given "type". 238 | | 239 | */ 240 | 241 | 'type_overrides' => [ 242 | 'integer' => 'int', 243 | 'boolean' => 'bool', 244 | ], 245 | 246 | /* 247 | |-------------------------------------------------------------------------- 248 | | Include DocBlocks from classes 249 | |-------------------------------------------------------------------------- 250 | | 251 | | Include DocBlocks from classes to allow additional code inspection for 252 | | magic methods and properties. 253 | | 254 | */ 255 | 256 | 'include_class_docblocks' => true, 257 | 258 | ]; 259 | -------------------------------------------------------------------------------- /updates/initial_gen.php: -------------------------------------------------------------------------------- 1 |