Completed
Push — master ( a8f538...8e198c )
by Mahmoud
07:38
created

User::timeTrackers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\User\Models;
4
5
use App\Containers\Authentication\Traits\TokenTrait;
6
use App\Containers\Stripe\Models\StripeAccount;
7
use App\Port\Model\Abstracts\Model;
8
use Illuminate\Auth\Authenticatable;
9
use Illuminate\Auth\Passwords\CanResetPassword;
10
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
11
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
12
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
13
use Illuminate\Database\Eloquent\SoftDeletes;
14
use Illuminate\Foundation\Auth\Access\Authorizable;
15
use Spatie\Permission\Traits\HasRoles;
16
17
/**
18
 * Class User.
19
 *
20
 * @author Mahmoud Zalt <[email protected]>
21
 */
22
class User extends Model implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract
23
{
24
    use Authenticatable, Authorizable, CanResetPassword, SoftDeletes, TokenTrait, HasRoles;
25
26
    /**
27
     * The database table used by the model.
28
     *
29
     * @var string
30
     */
31
    protected $table = 'users';
32
33
    /**
34
     * The attributes that are mass assignable.
35
     *
36
     * @var array
37
     */
38
    protected $fillable = [
39
        'name',
40
        'email',
41
        'password',
42
        'device',
43
        'platform',
44
        'confirmed',
45
        'gender',
46
        'birth',
47
        'social_provider',
48
        'social_token',
49
        'social_refresh_token',
50
        'social_expires_in',
51
        'social_token_secret',
52
        'social_id',
53
        'social_avatar',
54
        'social_avatar_original',
55
        'social_nickname',
56
    ];
57
58
    /**
59
     * The dates attributes.
60
     *
61
     * @var array
62
     */
63
    protected $dates = [
64
        'created_at',
65
        'updated_at',
66
        'deleted_at',
67
    ];
68
69
    /**
70
     * The attributes excluded from the model's JSON form.
71
     *
72
     * @var array
73
     */
74
    protected $hidden = [
75
        'password',
76
        'remember_token',
77
        'token',
78
    ];
79
80
    public function stripeAccount()
81
    {
82
        return $this->hasOne(StripeAccount::class);
83
    }
84
85
}
86