Laravel – How to prevent unique error if I have 3 fields in a table/model but need more than 1 item? (factory)
I have a unique index on 3 fields: public function up(): void { Schema::create('items', function (Blueprint $table) { $table->id(); $table->foreignId('points_id'); $table->foreignId('user_id'); $table->unsignedTinyInteger('status'); $table->timestamp('created_at')->useCurrent(); $table->foreign('user_id')->references('id')->on('users'); $table->foreign('points_id')->references('id')->on('points'); $table->unique(['points_id', 'user_id', 'status']); }); } I need to make a factory to create a lot…