我正在开发一个网站项目,我正在使用Laravel 5和PHPStorm 9 EAP.
我创建了一个迁移并使用此代码$table->string('name')->unique();,IDE突出显示unique()并显示一条消息Method "unique" not found in class Illuminate\Support\Fluent.
这是我的迁移:
class CreateProductsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('products', function(Blueprint $table)
{
$table->increments('id');
$table->string('name')->unique();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('products');
}
}
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?