branch_id) { $exists = DB::table('user_branches') ->where('user_id', $user->id) ->where('branch_id', $user->branch_id) ->exists(); if (!$exists) { DB::table('user_branches')->insert([ 'user_id' => $user->id, 'branch_id' => $user->branch_id, 'created_at' => now(), 'updated_at' => now(), ]); } } } $this->command->info('User branches seeded successfully.'); } }