OAuthIdentity::getTable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model as Eloquent;
6
7
/**
8
 * @property $id
9
 * @property $provider_user_id
10
 * @property $provider
11
 * @property $access_token
12
 * @property $user_id
13
 * @property $avatar
14
 * @property $name
15
 * @property $nickname
16
 */
17
class OAuthIdentity extends Eloquent
18
{
19
    /**
20
     * The attributes that are mass assignable.
21
     *
22
     * @var array
23
     */
24
    protected $fillable = [
25
        'id', 'provider_user_id', 'provider', 'access_token', 'user_id', 'avatar', 'name', 'nickname',
26
    ];
27
28
    /**
29
     * The attributes that should be hidden for arrays.
30
     *
31
     * @var array
32
     */
33
    protected $hidden = [];
34
35
    /**
36
     * The table associated with the model.
37
     *
38
     * @var string
39
     */
40
    protected $table = 'oauth_identities';
41
    protected static $configuredTable = 'oauth_identities';
42
43
    public static function configureTable($table)
44
    {
45
        static::$configuredTable = $table;
46
    }
47
48
    public function getTable()
49
    {
50
        return static::$configuredTable;
51
    }
52
53
    /**
54
     * Get the user that owns the oauth identity.
55
     */
56
    public function user()
57
    {
58
        return $this->belongsTo(\App\User::class);
59
    }
60
}
61