Passed
Push — dev5 ( 3534c9...5191cd )
by Ron
06:25
created

FileLinks   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 23
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fileLinkFiles() 0 3 1
A getAllowUploadAttribute() 0 3 2
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class FileLinks extends Model
8
{
9
    protected $primaryKey = 'link_id';
10
    protected $fillable = ['user_id', 'cust_id', 'link_hash', 'link_name', 'note', 'expire', 'allow_upload'];
11
    protected $casts = [
12
        'created_at' => 'datetime:M d, Y',
13
        'updated_at' => 'datetime:M d, Y',
14
        'expire'     => 'datetime:M d, Y'
15
    ];
16
17 18
    public function getAllowUploadAttribute()
18
    {
19 18
        return $this->attributes['allow_upload'] ? 'Yes' : 'No';
20
    }
21
22
    // public function users()
23
    // {
24
    //     return $this->belongsTo('App\Users', 'user_id', 'user_id');
25
    // }
26
27 6
    public function fileLinkFiles()
28
    {
29 6
        return $this->hasMany('App\FileLinkFiles', 'link_id', 'link_id');
30
    }
31
32
    // public function fileLinkInstructions()
33
    // {
34
    //     return $this->hasMany('App\FileLinkInstructions', 'link_id', 'link_id');
35
    // }
36
37
    // public function fileLinkNotes()
38
    // {
39
    //     return $this->hasMany('App\FileLinkNotes', 'link_id', 'link_id');
40
    // }
41
42
    // public function customers()
43
    // {
44
    //     return $this->belongsTo('App\Customers', 'cust_id', 'cust_id');
45
    // }
46
}
47