UserGatewayProfile   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A user() 0 3 1
1
<?php
2
3
namespace Squareetlabs\AuthorizeNet\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Relations\BelongsTo;
7
8
class UserGatewayProfile extends Model
9
{
10
    /**
11
     * The table associated with the model.
12
     *
13
     * @var string
14
     */
15
    protected $table = 'user_gateway_profiles';
16
17
    /**
18
     * The attributes that are mass assignable.
19
     *
20
     * @var array<int, string>
21
     */
22
    protected $fillable = [
23
        'user_id',
24
        'profile_id',
25
    ];
26
27
    /**
28
     * The attributes that should be cast.
29
     *
30
     * @var array<string, string>
31
     */
32
    protected $casts = [
33
        'created_at' => 'datetime',
34
        'updated_at' => 'datetime',
35
    ];
36
37
    /**
38
     * Get the user that owns the gateway profile.
39
     *
40
     * @return BelongsTo
41
     */
42
    public function user(): BelongsTo
43
    {
44
        return $this->belongsTo(config('auth.providers.users.model', 'App\Models\User'));
45
    }
46
}
47
48