Passed
Push — master ( 45eca1...10ee28 )
by Thomas
07:06
created

fixpaymentsstatus::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace App\Console\Commands;
4
5
use App\Models\Enrollment;
6
use App\Models\Invoice;
7
use App\Models\ScheduledPayment;
8
use Illuminate\Console\Command;
9
use Illuminate\Support\Facades\DB;
10
11
class fixpaymentsstatus extends Command
12
{
13
    protected $signature = 'academico:fix-payment-status';
14
15
    protected $description = 'Command description';
16
17
    public function handle()
18
    {
19
        foreach (ScheduledPayment::whereNull('status')->get() as $payment) {
20
            $payment->update(['status' => $payment->computed_status]);
21
        }
22
    }
23
}
24