Profile   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 17
c 2
b 1
f 0
dl 0
loc 56
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A theme() 0 3 1
A user() 0 3 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Profile extends Model
8
{
9
    /**
10
     * The database table used by the model.
11
     *
12
     * @var string
13
     */
14
    protected $table = 'profiles';
15
16
    /**
17
     * The attributes that are not mass assignable.
18
     *
19
     * @var array
20
     */
21
    protected $guarded = [
22
        'id',
23
    ];
24
25
    /**
26
     * Fillable fields for a Profile.
27
     *
28
     * @var array
29
     */
30
    protected $fillable = [
31
        'theme_id',
32
        'location',
33
        'bio',
34
        'twitter_username',
35
        'github_username',
36
        'user_profile_bg',
37
        'avatar',
38
        'avatar_status',
39
    ];
40
41
    protected $casts = [
42
        'theme_id' => 'integer',
43
    ];
44
45
    /**
46
     * A profile belongs to a user.
47
     *
48
     * @return mixed
49
     */
50
    public function user()
51
    {
52
        return $this->belongsTo(\App\Models\User::class);
53
    }
54
55
    /**
56
     * Profile Theme Relationships.
57
     *
58
     * @var array
59
     */
60
    public function theme()
61
    {
62
        return $this->hasOne(\App\Models\Theme::class);
63
    }
64
}
65