Laravel-ide-helper: Having problems with \Illuminate\Support\Fluent\ for nullable, index, unsigned, etc

Created on 12 Jan 2017  路  6Comments  路  Source: barryvdh/laravel-ide-helper

I was having troubles using the Blueprint Class on migrations, I was constantly having warnings using something like this:

   //after string there is no autocompletion  after string("foo") and warning in nullable
   $table->string("foo")->nullable()->index();

  //after string there is no autocompletion after integer("bar") and warning in unsigned
   $table->integer("bar")->unsigned();

I hadn't found any proper solution, some people was saying they didn't had that problem, but based on this link http://stackoverflow.com/a/32811541 I added this to the end of my _ide-helper.php file and every thing started to work.

   namespace Illuminate\Support{
        /**
         * @method Fluent first()
         * @method Fluent after($column)
         * @method Fluent change()
         * @method Fluent nullable()
         * @method Fluent unsigned()
         * @method Fluent unique()
         * @method Fluent index()
         * @method Fluent primary()
         * @method Fluent default($value)
         * @method Fluent onUpdate($value)
         * @method Fluent onDelete($value)
         * @method Fluent references($value)
         * @method Fluent on($value)
         */
        class Fluent {}
    }

I think you should add this to the the ide-helper.

Well, hope you find this useful;
By the way, thanks for this tool, otherwise phpstorm would be a painful collection of warning screams all over the place, and even worst without autocompletion!!!

Most helpful comment

Did you set include_fluent to true in the config?

All 6 comments

Same problem here, the solution worked fine

Did you set include_fluent to true in the config?

Oh I see, that definitely fixed it.
My bad, can this be included in the readme?

Sure, can you create a PR?

How can I do that in a Lumen application? There is no config file.

The readme already contains the reference to include_fluent.

For lumen, I guess the config has to be copied manually?

@barryvdh the original issue has been resolved, I suggest to close this one :}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ttomdewit picture ttomdewit  路  5Comments

hatamiarash7 picture hatamiarash7  路  3Comments

GitzJoey picture GitzJoey  路  4Comments

ivansammartino picture ivansammartino  路  3Comments

quantumwebco picture quantumwebco  路  4Comments