User   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 30
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A tasks() 0 2 1
A setPasswordAttribute() 0 2 1
A apikeys() 0 2 1
1
<?php
2
3
namespace TaskManager;
4
5
use Illuminate\Notifications\Notifiable;
6
use Illuminate\Foundation\Auth\User as Authenticatable;
7
8
class User extends Authenticatable
9
{
10
    use Notifiable;
11
12
    /**
13
     * The attributes that are mass assignable.
14
     *
15
     * @var array
16
     */
17
    protected $fillable = [
18
        'name', 'email', 'password',
19
    ];
20
    protected $guarded = ['token'];
21
    /**
22
     * The attributes that should be hidden for arrays.
23
     *
24
     * @var array
25
     */
26
    protected $hidden = [
27
        'password', 'remember_token',
28
    ];
29
30
    public function setPasswordAttribute($value){
31
        $this->attributes['password'] = bcrypt($value);
32
    }
33
    public function apikeys(){
34
        return $this->hasOne('\App\ApiKeys');
35
    }
36
    public function tasks(){
37
        return $this->hasMany('\TaskManager\Tasks');
38
    }
39
    
40
}
41