Laravel-ide-helper: Helper for migrations?

Created on 6 Jul 2016  路  4Comments  路  Source: barryvdh/laravel-ide-helper

When I make a new migration and add ->nullable() or $table->foreign(...)->references(..) phpStorm couldn't find those methods. Is it happening only to me?

    "barryvdh/laravel-ide-helper": "^2.2",
    "doctrine/dbal": "^2.5"

Most helpful comment

Nevermind, Adding this code to _ide_helper.php in the end solved the problem:

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 {}
}

All 4 comments

Nevermind, Adding this code to _ide_helper.php in the end solved the problem:

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 {}
}

Did you do this manually?

I'd love to have those ->nullable() etc autocomplete methods available to me, but they never are! Would love to fix that.

Yea, place it at the bottom of the _ide_helper file. don't forget that if you generate a fresh _ide_helper.php file, it'll be reset.

@barryvdh Can this be added to the _ide_helper.php generator?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kickthemooon picture kickthemooon  路  3Comments

half-evil picture half-evil  路  3Comments

ttomdewit picture ttomdewit  路  5Comments

celorodovalho picture celorodovalho  路  4Comments

GitzJoey picture GitzJoey  路  4Comments