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

User::orders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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