Skip to content

Commit 555d3e3

Browse files
Zimin Caobarryvdh
Zimin Cao
authored andcommitted
Add documentation in readme.md for Laravel Fluent methods support (#446)
* Added readme for Fluent methods * Add readme for Laravel Fluent methods
1 parent 963ead0 commit 555d3e3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

readme.md

+12
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ php artisan ide-helper:models --ignore="Post,User"
151151

152152
Note: With namespaces, wrap your model name in " signs: `php artisan ide-helper:models "API\User"`, or escape the slashes (`Api\\User`)
153153

154+
### Automatic phpDocs generation for Laravel Fluent methods
155+
If you need phpDocs support for Fluent methods in migration, for example
156+
```php
157+
$table->string(“somestring”)->nullable()->index();
158+
```
159+
After publishing vendor, simply change the `include_fluent` line your `config/ide-helper.php` file into:
160+
```php
161+
'include_fluent' => true,
162+
```
163+
And then run `php artisan ide-helper:generate` , you will now see all of the Fluent methods are recognized by your IDE now.
164+
165+
154166
## PhpStorm Meta for Container instances
155167

156168
It's possible to generate a PhpStorm meta file to [add support for factory design pattern](https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata). For Laravel, this means we can make PhpStorm understand what kind of object we are resolving from the IoC Container. For example, `events` will return an `Illuminate\Events\Dispatcher` object, so with the meta file you can call `app('events')` and it will autocomplete the Dispatcher methods.

0 commit comments

Comments
 (0)