Laravel: Seeding multiple unique columns with Faker
问题 Introduction What up folks, I got a question about model factories and multiple unique columns: Background I have a model named Image. This model has language support stored in a separate model, ImageText . ImageText has an image_id column, a language column and a text column. ImageText has a constraint in MySQL that the combination image_id and language has to be unique. class CreateImageTextsTable extends Migration { public function up() { Schema::create('image_texts', function ($table) { .