Test Failed
Pull Request — master (#13)
by
unknown
18:55
created

User   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 6
dl 0
loc 29
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sendPasswordResetNotification() 0 7 1
A linkedSocialAccounts() 0 4 1
1
<?php
2
3
namespace MedianetDev\LaravelAuthApi\Models;
4
5
use Illuminate\Auth\Authenticatable;
6
use Illuminate\Auth\Passwords\CanResetPassword;
7
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
8
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
9
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
10
use Illuminate\Database\Eloquent\Model;
11
use Illuminate\Foundation\Auth\Access\Authorizable;
12
use Illuminate\Notifications\Notifiable;
13
use MedianetDev\LaravelAuthApi\Http\Controllers\Traits\MustVerifyEmail;
14
15
class User extends Model implements
16
    AuthenticatableContract,
17
    AuthorizableContract,
18
    CanResetPasswordContract
19
{
20
    use Authenticatable, Authorizable, CanResetPassword, MustVerifyEmail, Notifiable;
21
22
    /**
23
     * Send the password reset notification.
24
     *
25
     * @param  string  $token
26
     * @return void
27
     */
28
    public function sendPasswordResetNotification($token)
29
    {
30
        // get the notification template from the config file
31
        $passwordTemplate = config('laravel-auth-api.password_notification');
32
        // send the notification
33
        $this->notify(new $passwordTemplate($token));
34
    }
35
36
    /**
37
     * social accounts.
38
     */
39
    public function linkedSocialAccounts()
40
    {
41
        return $this->hasMany(LinkedSocialAccount::class);
42
    }
43
}
44