The call $table->integer('user_id')returns a new instance Illuminate\Support\Fluent. But the Fluent class does not provide a method unique(). Instead, it uses the magic PHP method __call. This is why PHPStorm complains.
1 - PHPStorm, unique() . PHPDoc vendor/laravel/framework/src/Illuminate/Support/Fluent.php PHPStorm, unique() :
class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
{
}
/vendor/. / Laravel. - (https://github.com/illuminate/support/pull/25).
- Fluent:
Schema::create('products', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->unique('name');
$table->timestamps();
});