Laravel-ide-helper: Illuminate\Support\Fluent Methods in Migration not found

Created on 1 Apr 2015  路  6Comments  路  Source: barryvdh/laravel-ide-helper

For example in User table migration:

    public function up()
    {
        Schema::create('users', function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password', 60);
            $table->rememberToken();
            $table->timestamps();
        });
    }

unique() is not found

Using PHPStorm.

Most helpful comment

@barryvdh

I added the following code to end of _ide_helper.php file. And the problem was solved.

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

Before:
before

After:
after

All 6 comments

Probably because the string() call doesn't return proper phpdoc

laravel

The functions returns phpdoc. The return is Fluent.

It would be great to have support for chaining of schema methods. :(

@barryvdh

I added the following code to end of _ide_helper.php file. And the problem was solved.

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

Before:
before

After:
after

The same issue is discussed here: https://github.com/barryvdh/laravel-ide-helper/issues/425

A more clean solution is to configure ide-helper to include fluent, as described here: https://github.com/barryvdh/laravel-ide-helper#automatic-phpdocs-generation-for-laravel-fluent-methods

@spawnia Lumen dont have vendor:publish command

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marcus-clements picture marcus-clements  路  3Comments

ghost picture ghost  路  5Comments

beniaminorossini picture beniaminorossini  路  5Comments

anik786 picture anik786  路  3Comments

Newbie012 picture Newbie012  路  4Comments