Summary::mount()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 4
c 1
b 0
f 0
nc 4
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Adminetic\Website\Http\Livewire\Admin\Career;
4
5
use Adminetic\Website\Models\Admin\Career;
6
use Livewire\Component;
7
8
class Summary extends Component
9
{
10
    public $career_id;
11
    public $updateMode = false;
12
    public $removes = [];
13
    public $summary = [];
14
    public $i = 0;
15
16
    public function mount($career_id = null)
17
    {
18
        $this->career_id = $career_id;
19
        $career = Career::find($career_id);
20
        $this->i = isset($career->summary) ? count($career->summary) : 0;
21
        $this->summary = isset($career->summary) ? $career->summary : [];
22
    }
23
24
    public function add($i)
25
    {
26
        $i += 1;
27
        $this->i = $i;
28
    }
29
30
    public function remove($key)
31
    {
32
        array_push($this->removes, $key);
33
    }
34
35
    public function render()
36
    {
37
        return view('website::livewire.admin.career.summary');
38
    }
39
}
40