Url   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 30
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A clicks() 0 3 1
A user() 0 3 1
1
<?php
2
3
namespace Devpri\Tinre\Models;
4
5
use Devpri\Tinre\Traits\AuthorizedActions;
6
use Illuminate\Database\Eloquent\Model;
7
8
class Url extends Model
9
{
10
    use AuthorizedActions;
11
12
    protected $actions = ['viewAny', 'view', 'create', 'update', 'delete'];
13
14
    /**
15
     * The attributes that are mass assignable.
16
     *
17
     * @var array
18
     */
19
    protected $fillable = ['path', 'full_url', 'user_id'];
20
21
    /**
22
     * The attributes that should be cast.
23
     *
24
     * @var array
25
     */
26
    protected $casts = [
27
        'user_id' => 'integer',
28
    ];
29
30 14
    public function user()
31
    {
32 14
        return $this->belongsTo('Devpri\Tinre\Models\User');
33
    }
34
35 2
    public function clicks()
36
    {
37 2
        return $this->hasMany('Devpri\Tinre\Models\Click');
38
    }
39
}
40