Test Failed
Push — master ( f6c91d...7200d2 )
by Gianluca
16:47
created

User   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 14
c 1
b 0
f 1
dl 0
loc 38
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A orders() 0 2 1
1
<?php
2
namespace Mongi\Mongicommerce\Models;
3
4
5
use Mongi\Mongicommerce\Models\Order;
6
use Illuminate\Notifications\Notifiable;
7
use Illuminate\Database\Eloquent\Factories\HasFactory;
8
use Illuminate\Foundation\Auth\User as Authenticatable;
9
10
class User extends Authenticatable
11
{
12
    use HasFactory, Notifiable;
0 ignored issues
show
Bug introduced by
The trait Illuminate\Notifications\Notifiable requires the property $email which is not provided by Mongi\Mongicommerce\Models\User.
Loading history...
13
14
    /**
15
     * The attributes that are mass assignable.
16
     *
17
     * @var array
18
     */
19
    protected $fillable = [
20
        'name',
21
        'first_name',
22
        'last_name',
23
        'email',
24
        'password',
25
    ];
26
27
    /**
28
     * The attributes that should be hidden for arrays.
29
     *
30
     * @var array
31
     */
32
    protected $hidden = [
33
        'password',
34
        'remember_token',
35
    ];
36
37
    /**
38
     * The attributes that should be cast to native types.
39
     *
40
     * @var array
41
     */
42
    protected $casts = [
43
        'email_verified_at' => 'datetime',
44
    ];
45
46
    public function orders(){
47
        return $this->hasMany(Order::class,'user_id');
48
    }
49
}
50