Profile::theme()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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