Completed
Push — development ( 24d50c...7ed4f4 )
by Ashutosh
10:17
created

Github   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 8
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPasswordAttribute() 0 6 2
A setPasswordAttribute() 0 4 1
1
<?php
2
3
namespace App\Model\Github;
4
5
use App\BaseModel;
6
7
class Github extends BaseModel
8
{
9
    protected $table = 'githubs';
10
    protected $fillable = ['client_id', 'client_secret', 'username', 'password'];
11
12
   public function getPasswordAttribute($value)
13
    {
14
    	if($value){
15
    	$value = \Crypt::decrypt($value);
16
     }
17
     return $value;
18
    }
19
20
    public function setPasswordAttribute($value)
21
    {
22
    	$value = \Crypt::encrypt($value);
23
    	$this->attributes['password'] = $value;
24
    	
25
    }
26
}
27
28