GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Theme   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 72
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 10 3
A profile() 0 3 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
8
class Theme extends Model
9
{
10
    use SoftDeletes;
11
12
    /**
13
     * The database table used by the model.
14
     *
15
     * @var string
16
     */
17
    protected $table = 'themes';
18
19
    /**
20
     * The attributes that are not mass assignable.
21
     *
22
     * @var array
23
     */
24
    protected $guarded = [
25
        'id',
26
    ];
27
28
    /**
29
     * Fillable fields for a Profile.
30
     *
31
     * @var array
32
     */
33
    protected $fillable = [
34
        'name',
35
        'link',
36
        'notes',
37
        'status',
38
        'taggable_id',
39
        'taggable_type',
40
    ];
41
42
    /**
43
     * The attributes that should be mutated to dates.
44
     *
45
     * @var array
46
     */
47
    protected $dates = [
48
        'deleted_at',
49
    ];
50
51
    /**
52
     * Get a validator for an incoming registration request.
53
     *
54
     * @param array $data
55
     *
56
     * @return array
57
     */
58
    public static function rules($id = 0, $merge = [])
59
    {
60
        return array_merge(
61
            [
62
                'name'   => 'required|min:3|max:50|unique:themes,name'.($id ? ",$id" : ''),
63
                'link'   => 'required|min:3|max:255|unique:themes,link'.($id ? ",$id" : ''),
64
                'notes'  => 'max:500',
65
                'status' => 'required',
66
            ],
67
            $merge);
68
    }
69
70
    /**
71
     * Build Theme Relationships.
72
     *
73
     * @var array
74
     *
75
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
76
     */
77
    public function profile()
78
    {
79
        return $this->hasMany('App\Models\Profile');
80
    }
81
}
82