2015-11-21 12:22:14 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BookStack\Console\Commands;
|
|
|
|
|
2023-05-17 12:56:55 -04:00
|
|
|
use BookStack\Activity\Models\Activity;
|
2015-11-21 12:22:14 -05:00
|
|
|
use Illuminate\Console\Command;
|
|
|
|
|
2023-05-24 08:21:46 -04:00
|
|
|
class ClearActivityCommand extends Command
|
2015-11-21 12:22:14 -05:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name and signature of the console command.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2017-02-26 04:14:18 -05:00
|
|
|
protected $signature = 'bookstack:clear-activity';
|
2015-11-21 12:22:14 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The console command description.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2024-05-04 11:28:18 -04:00
|
|
|
protected $description = 'Clear user (audit-log) activity from the system';
|
2017-02-26 04:14:18 -05:00
|
|
|
|
2015-11-21 12:22:14 -05:00
|
|
|
/**
|
|
|
|
* Execute the console command.
|
|
|
|
*/
|
2023-05-24 07:59:50 -04:00
|
|
|
public function handle(): int
|
2015-11-21 12:22:14 -05:00
|
|
|
{
|
2023-05-24 07:59:50 -04:00
|
|
|
Activity::query()->truncate();
|
2017-02-26 04:14:18 -05:00
|
|
|
$this->comment('System activity cleared');
|
2023-05-24 07:59:50 -04:00
|
|
|
return 0;
|
2015-11-21 12:22:14 -05:00
|
|
|
}
|
|
|
|
}
|