Skip to content

Commit 015f4eb

Browse files
committed
Added archiving process
1 parent 08db0c2 commit 015f4eb

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

src/Console/LaravelCrmArchive.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
3+
namespace VentureDrake\LaravelCrm\Console;
4+
5+
use Carbon\Carbon;
6+
use Illuminate\Console\Command;
7+
use Illuminate\Support\Composer;
8+
use VentureDrake\LaravelCrm\Services\SettingService;
9+
10+
class LaravelCrmArchive extends Command
11+
{
12+
/**
13+
* @var SettingService
14+
*/
15+
private $settingService;
16+
17+
/**
18+
* The name and signature of the console command.
19+
*
20+
* @var string
21+
*/
22+
protected $signature = 'laravelcrm:archive';
23+
24+
/**
25+
* The console command description.
26+
*
27+
* @var string
28+
*/
29+
protected $description = 'Archiving Laravel CRM data';
30+
31+
/**
32+
* The Composer instance.
33+
*
34+
* @var \Illuminate\Foundation\Composer
35+
*/
36+
protected $composer;
37+
38+
/**
39+
* Create a new command instance.
40+
*
41+
* @return void
42+
*/
43+
public function __construct(Composer $composer, SettingService $settingService)
44+
{
45+
parent::__construct();
46+
$this->composer = $composer;
47+
$this->settingService = $settingService;
48+
}
49+
50+
/**
51+
* Execute the console command.
52+
*
53+
* @return mixed
54+
*/
55+
public function handle()
56+
{
57+
$this->info('Laravel CRM archiving...');
58+
59+
//
60+
61+
$this->info('Archive CRM archiving complete.');
62+
}
63+
}

src/LaravelCrmServiceProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,11 @@ function ($perPage = 30, $page = null, $options = []) {
548548
->everyMinute()
549549
->withoutOverlapping();
550550

551+
$schedule->command('laravelcrm:archive')
552+
->name('laravelCrmArchiving')
553+
->daily()
554+
->withoutOverlapping();
555+
551556
if (config('xero.clientId') && config('xero.clientSecret')) {
552557
$schedule->command('xero:keep-alive')
553558
->name('laravelCrmXeroKeepAlive')

0 commit comments

Comments
 (0)