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

Github::setPasswordAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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