]> BookStack Code Mirror - bookstack/blob - app/Console/Commands/ClearActivity.php
Fix ajax tag suggestion for subdir installs
[bookstack] / app / Console / Commands / ClearActivity.php
1 <?php
2
3 namespace BookStack\Console\Commands;
4
5 use BookStack\Activity;
6 use Illuminate\Console\Command;
7
8 class ClearActivity extends Command
9 {
10     /**
11      * The name and signature of the console command.
12      *
13      * @var string
14      */
15     protected $signature = 'bookstack:clear-activity';
16
17     /**
18      * The console command description.
19      *
20      * @var string
21      */
22     protected $description = 'Clear user activity from the system';
23
24     protected $activity;
25
26     /**
27      * Create a new command instance.
28      *
29      * @param Activity $activity
30      */
31     public function __construct(Activity $activity)
32     {
33         $this->activity = $activity;
34         parent::__construct();
35     }
36
37     /**
38      * Execute the console command.
39      *
40      * @return mixed
41      */
42     public function handle()
43     {
44         $this->activity->newQuery()->truncate();
45         $this->comment('System activity cleared');
46     }
47 }