Closed pasamsin closed 4 years ago
What command did you run exactly? What was the output? What version of ide-helper?
Phpstorm 2020.1 ide-helper version latest 2.7.0 The commands that I run respectively. composer require --dev barryvdh/laravel-ide-helper
And config/app.php add line; Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
And vendor/barryvdh/laravel-ide-helper/config/ide-helper.php edit line; 'include_fluent' => true,
and command run; php artisan ide-helper:generate php artisan ide-helper:meta
`composer require --dev barryvdh/laravel-ide-helper Using version ^2.7 for barryvdh/laravel-ide-helper ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 14 installs, 0 updates, 0 removals
Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Discovered Package: barryvdh/laravel-ide-helper Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. 52 packages you are using are looking for funding. Use the
composer fund
command to find out more! pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan ide-helper:generate A new helper file was written to _ide_helper.php pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan ide-helper:generate A new helper file was written to _ide_helper.php pasamsin-MacBook-Pro:ZPANEL pasamsin$ composer dump-autoload Generating optimized autoload files Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Discovered Package: barryvdh/laravel-ide-helper Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. Generated optimized autoload files containing 5022 classes pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan config:cache Configuration cache cleared! Configuration cached successfully! pasamsin-MacBook-Pro:ZPANEL pasamsin$ composer dump-autoload Generating optimized autoload files Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Discovered Package: barryvdh/laravel-ide-helper Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. Generated optimized autoload files containing 5022 classes pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan config:cache Configuration cache cleared! Configuration cached successfully! pasamsin-MacBook-Pro:ZPANEL pasamsin$ composer dump-autoload Generating optimized autoload files Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Discovered Package: barryvdh/laravel-ide-helper Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. Generated optimized autoload files containing 5022 classes pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan ide-helper:generate A new helper file was written to _ide_helper.php pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan cache:clear Application cache cleared! pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan ide-helper:generate A new helper file was written to _ide_helper.php pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan ide-helper:meta A new meta file was written to .phpstorm.meta.php pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan cache:clear Application cache cleared! pasamsin-MacBook-Pro:ZPANEL pasamsin$ composer dump-autoload Generating optimized autoload files Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Discovered Package: barryvdh/laravel-ide-helper Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. Generated optimized autoload files containing 5022 classes pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan cache:clear Application cache cleared! pasamsin-MacBook-Pro:ZPANEL pasamsin$ composer dump-autoload Generating optimized autoload files ^[[A^[[A> Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Discovered Package: barryvdh/laravel-ide-helper Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. Generated optimized autoload files containing 5022 classes pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan cache:clear Application cache cleared! pasamsin-MacBook-Pro:ZPANEL pasamsin$ composer dump-autoload Generating optimized autoload files ^[[B^[[A> Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Discovered Package: barryvdh/laravel-ide-helper Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. Generated optimized autoload files containing 5022 classes ^[[Bpasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan cache:clear Application cache cleared! pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan cache:clear Application cache cleared! pasamsin-MacBook-Pro:ZPANEL pasamsin$ composer dump-autoload Generating optimized autoload files Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Discovered Package: barryvdh/laravel-ide-helper Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. Generated optimized autoload files containing 5022 classes pasamsin-MacBook-Pro:ZPANEL pasamsin$ php artisan ide-helper:generate A new helper file was written to _ide_helper.php `
I created a new project with laravel v6.18.8. I installed barryvdh/laravel-ide-helper. I wrote "$table->string('test')->u" in the migration file and completed it as "$table->string('test')->unique();". Doesn't there support for barryvdh/laravel-ide-helper in laravel 7.x?
Thanks, got it. Turns out I can't read properly, it's what you wrote in the first comment 😅
Would you mind adjusting the issue title so something more useful? E.g. "Blueprint unique autocomplete not working"
Maybe it's a bug in phpstorm, because yes, autocomplete for tit doesn't not work however it recognizes the property and you can ctrl-click and jump to it!
but
The strange color 😅 indicates it is "recognized", when I ctrl-click on it I get to https://github.com/laravel/framework/blob/52d95bb75b1744d74dcedb1d465ad3316fecbda5/src/Illuminate/Database/Schema/ColumnDefinition.php#L25
Aha, this change "broke" it => https://github.com/laravel/framework/pull/33293
If you change the file back to the previous version using ColumnDefinition
instead of static
, autocomplete works for me => https://github.com/laravel/framework/blob/06ba2a99956161cca51008f19b6a18e548b31b6d/src/Illuminate/Database/Schema/ColumnDefinition.php
However: this is nothing ide-helper actually "does" 😄 in this case
This is pure standard IDE autocomplete behavior and you're not autocompleting on anything provided by ide-helper.
The Blueprint
method string
returns ColumnDefinition
and therein a change caused the problem.
(for example we've the config include_fluent
for then Blueprint
methods return just Fluent
, but this is not the case here).
I think needs to needs to be taken up with PhpStorm support https://youtrack.jetbrains.com/
I could not find anything in YouTrack (can't actually believe this, but the for "static method phpdoc" have me hundreds of results I did quickly scan without luck), so I created a new issue => https://youtrack.jetbrains.com/issue/WI-54071
Let's see what the feedback will there.
Although in a sense this issue here is not related to the package, we deal a lot with the IDE autocomplete / interop so I think it make sense to keep it open for tracking/discussing and observing what Jetbrains thinks about this.
@barryvdh we can close this issue:
Closing, as I still believe nothing to be done here anymore.
Laravels phpdoc for \Illuminate\Database\Schema\ColumnDefinition
was already fixed an it's working.
why not autocomplete. I use PHPStorm. My project is Laravel version 7
migration file;
Schema::create('personel', function (Blueprint $table) { $table->id(); $table->timestamps(); $table->integer('us_id')->un // Cannot complate unique });
config/ide-helper.php`<?php
return array(
); `