Completed
Branch develop (ac330a)
by Abhishek Kumar
05:09
created

User   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A setPasswordAttribute() 0 3 1
1
<?php
2
3
namespace Tests;
4
5
use Illuminate\Notifications\Notifiable;
6
use Illuminate\Foundation\Auth\User as Authenticatable;
7
8
class User extends Authenticatable
9
{
10
    use Notifiable;
0 ignored issues
show
introduced by
The trait Illuminate\Notifications\Notifiable requires some properties which are not provided by Tests\User: $email, $phone_number
Loading history...
11
12
    /**
13
     * The attributes that are mass assignable.
14
     *
15
     * @var array
16
     */
17
    protected $fillable = [
18
        'name', 'email', 'password',
19
    ];
20
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
31
    /**
32
    * Password mulator
33
    *
34
    * Encrypt password while storing.
35
    * @param $value
36
    * @return void
37
    */
38
    public function setPasswordAttribute($value)
39
    {
40
        $this->attributes['password'] = bcrypt( $value );
41
    }
42
}
43