Laravel IDE Helper & Generator
Complete phpDocs, directly from the source
Add the helper file to your laravel folder (not in a public folder). The file isn't used by Laravel, but it has to be indexed by your IDE.
- Netbeans and PHPStorm version: https://gist.github.com/barryvdh/5227822
- SublimeText CodeIntel version: https://gist.github.com/barryvdh/5227814
Automatic phpDoc generation for Laravel Facades
Require this package in your composer.json:
"barryvdh/laravel-ide-helper": "dev-master"
And add the ServiceProvider to the providers array in app/config/app.php
'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
You can now re-generate the docs yourself (for future updates) in artisan
php artisan ide-helper:generate
If you use SublimeText CodeIntel, the format is a bit different. So add --sublime (or -S) to your command
php artisan ide-helper:generate -S
Note: You do need CodeIntel for Sublime Text: https://github.com/Kronuz/SublimeCodeIntel
You can also publish the config-file to change implementations (ie. interface to specific class) or set defaults for --helpers or --sublime.
php artisan config:publish barryvdh/laravel-ide-helper
The generator tries to identify the real class, but if it cannot be found, you can define it in the config file.
Some classes need a working database connection. If you do not have a working default connection, some facades will not be included. You can use a in-memory sqlite driver, using the -M option.
You can choose to include helper files. This is not enabled by default, but you can override this with the --helpers (-H) option. The Illuminate/Support/helpers.php is already set-up, but you can add/remove your own files in the config file.
Work in progress: Model docs
If you don't want to write your properties yourself, you can use the (experimental) command ide-helper:models to generate
phpDocs, based on table columns, relations and getters/setters. Very alpha, so please provide feedback if you want.
Docs are written to a phpfile in the root of the project, so you can move the docs to the real model.
For now, only models in app/models are scanned, with the same name as the file (eg. app/models/user.php -> User).
With the -M option, you can generate just one model.
php artisan ide-helper:models -M Post