Skip to content

Commit

Permalink
Update console output
Browse files Browse the repository at this point in the history
  • Loading branch information
dansoppelsa committed Sep 25, 2017
1 parent e85c327 commit 4d36f26
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/Console/Scrub.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,23 @@ public function __construct()

public function handle()
{
$this->info("Entering Carwash...");
$this->line("");

collect(config('carwash'))->each(function ($fields, $table) {
$this->info("Scrubbing table {$table}.");
$this->getRecordsFromTable($table)
->each(function ($record) use ($fields, $table) {
$this->scrubRecord($record, $table, $fields);
});
$this->info("{$table} table scrubbed.");
$this->info("Scrubbing table <error>{$table}</error>...");

$records = $this->getRecordsFromTable($table);
$this->info("Found {$records->count()} records...");
$records->each(function ($record) use ($fields, $table) {
$this->scrubRecord($record, $table, $fields);
});

$this->info("<error>{$table}</error> table scrubbed.");
$this->line("");
});

$this->info("Carwash complete.");
$this->info("...Exiting Carwash");
}

private function scrubRecord($record, $table, $fields)
Expand Down

0 comments on commit 4d36f26

Please sign in to comment.