Laravel 4: making a combination of values/columns unique

后端 未结 5 1981
灰色年华
灰色年华 2020-12-14 01:07

I\'m importing a bunch of csv entries in my database with Laravel 4.

I can\'t really point at one column that has to be unique, it\'s a combination of 5 columns that

5条回答
  •  无人及你
    2020-12-14 01:42

    You can combine:

    $table->unique( array('email','name') );
    

    And pretty much everything in Laravel will accept arrays to do whatever you need to with 'more than one'.

提交回复
热议问题