Completed
Push — dev ( a58284...b96e59 )
by Darko
09:21
created

RemoveInactiveAccounts   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A handle() 0 3 1
1
<?php
2
3
namespace App\Jobs;
4
5
use App\Models\User;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Queue\SerializesModels;
8
use Illuminate\Queue\InteractsWithQueue;
9
use Illuminate\Contracts\Queue\ShouldQueue;
10
use Illuminate\Foundation\Bus\Dispatchable;
11
12
class RemoveInactiveAccounts implements ShouldQueue
13
{
14
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Jobs\RemoveInactiveAccounts: $id, $class, $relations
Loading history...
15
16
    /**
17
     * Create a new job instance.
18
     *
19
     * @return void
20
     */
21
    public function __construct()
22
    {
23
        //
24
    }
25
26
    /**
27
     * Execute the job.
28
     *
29
     * @return void
30
     */
31
    public function handle()
32
    {
33
        User::query()->where('lastlogin', '<', now()->subMonths(6))->where('apiaccess', '<', now()->subMonths(6))->where('roles_id', 1)->delete();
34
    }
35
}
36