untymage
5 months ago

two range of number for data seeding

Posted 5 months ago by untymage

I want to seed my pivot table like this :

DB::table('tag_thread')->insert([
    ['tag_id' => 51, 'thread_id' => 1],
    ['tag_id' => 52, 'thread_id' => 2],
    ['tag_id' => 53, 'thread_id' => 3],
    ['tag_id' => 54, 'thread_id' => 4],
    ['tag_id' => 55, 'thread_id' => 5],
    ['tag_id' => 56, 'thread_id' => 6],
    ['tag_id' => 57, 'thread_id' => 7],
    ['tag_id' => 58, 'thread_id' => 8],
    ['tag_id' => 59, 'thread_id' => 9],
    ['tag_id' => 60, 'thread_id' => 10],
]);

is there another good approach for this kind of seeding ? there is two range of number 50-60 and 1-10

Please sign in or create an account to participate in this conversation.