1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Updated command classes to include "Command" in name

This commit is contained in:
Dan Brown
2023-05-24 13:21:46 +01:00
parent c0620da9f8
commit 431aeefdda
14 changed files with 14 additions and 14 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace BookStack\Console\Commands;
use BookStack\Entities\Models\PageRevision;
use Illuminate\Console\Command;
class ClearRevisionsCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'bookstack:clear-revisions
{--a|all : Include active update drafts in deletion}
';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Clear page revisions';
/**
* Execute the console command.
*/
public function handle(): int
{
$deleteTypes = $this->option('all') ? ['version', 'update_draft'] : ['version'];
PageRevision::query()->whereIn('type', $deleteTypes)->delete();
$this->comment('Revisions deleted');
return 0;
}
}