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
|
|
|
|