<?php

namespace Northstar\Console\Commands;

use Northstar\Models\User;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
use Northstar\Jobs\SendUserToCustomerIo;

class BackfillCustomerIo extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'northstar:cio';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Re-export all profiles to Customer.io.';

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle()
    {
        // @TODO: Running this command will cause users to be sent to customer.io twice
        $query = User::where('cio_full_backfill', '!=', true);
        $progress = $this->output->createProgressBar($query->count());

        $query->chunkById(200, function (Collection $users) use ($progress) {
            $users->each(function (User $user) use ($progress) {
                dispatch(new SendUserToCustomerIo($user));
                $progress->advance();
            });
        });

        $this->info(' Done!');
    }
}

<?php

namespace Northstar\Console\Commands;

use Northstar\Models\User;
use Illuminate\Console\Command;
use Northstar\Services\CustomerIo;
use Illuminate\Support\Collection;
use Northstar\Jobs\SendUserToCustomerIo;

class BackfillCustomerIo extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'northstar:cio';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Re-export all profiles to Customer.io.';

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle(CustomerIo $customerIo)
    {
        // @TODO: Running this command will cause users to be sent to customer.io twice
        $query = User::where('cio_full_backfill', '!=', true);
        $progress = $this->output->createProgressBar($query->count());

        $query->chunkById(200, function (Collection $users) use ($customerIo, $progress) {
            $users->each(function (User $user) use ($customerIo, $progress) {
                dispatch(new SendUserToCustomerIo($user));
                $progress->advance();
            });
        });

        $this->info(' Done!');
    }
}

--- 
+++ 
@@ -4,7 +4,6 @@
 
 use Northstar\Models\User;
 use Illuminate\Console\Command;
-use Northstar\Services\CustomerIo;
 use Illuminate\Support\Collection;
 use Northstar\Jobs\SendUserToCustomerIo;
 
@@ -29,14 +28,14 @@
      *
      * @return void
      */
-    public function handle(CustomerIo $customerIo)
+    public function handle()
     {
         // @TODO: Running this command will cause users to be sent to customer.io twice
         $query = User::where('cio_full_backfill', '!=', true);
         $progress = $this->output->createProgressBar($query->count());
 
-        $query->chunkById(200, function (Collection $users) use ($customerIo, $progress) {
-            $users->each(function (User $user) use ($customerIo, $progress) {
+        $query->chunkById(200, function (Collection $users) use ($progress) {
+            $users->each(function (User $user) use ($progress) {
                 dispatch(new SendUserToCustomerIo($user));
                 $progress->advance();
             });
Remove references to customer.io service class
