pageRevision = $pageRevision; parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $deleteTypes = $this->option('all') ? ['version', 'update_draft'] : ['version']; $this->pageRevision->newQuery()->whereIn('type', $deleteTypes)->delete(); $this->comment('Revisions deleted'); } }