Skip to content

Commit

Permalink
Fix issues in artisan command.
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdeeptarat committed May 22, 2016
1 parent 14a0de1 commit 22edbe6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Console/ClearRevisionsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use DateTime;
use Illuminate\Console\Command;
use ConceptByte\TimeTraveller\Models\Revision;

class ClearRevisionsCommand extends Command
{
Expand Down Expand Up @@ -31,9 +32,10 @@ public function handle()
$date = new DateTime;
$interval = config('timetraveller.clear');

if ($this->confirm('Do you wish to continue? [y|N]')) {
if ($this->confirm('Do you wish to continue clearing revisions?')) {
$date->modify("-$interval days")->format('Y-m-d H:i:s');
return Revision::where('created_at', '<=', $date)->delete();
}
$this->info('Old revision cleared');
}
}

0 comments on commit 22edbe6

Please sign in to comment.