So I have a relationship table like this ERD. I'm using eloquent database relationship in laravel to manage the foreign key.
It worked, but the data added is skipping one row.
This is how I seed the database.
public function run(): void
{
User::factory()
->has(FavPlant::factory(),'fav_Plant')
->count(5)
->create();
Plants::factory()
->has(FavPlant::factory(),'fav_Plant')
->count(5)
->create();
}
How do I make the relation table have both user_id and plants_id simultaneously?

You seem to have a many-to-many relationship between users and plants through the FavPlant pivot table. You can set both
user_idandplant_idat the same time as below.