Total Complexity | 3 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class CustomerFile extends Model |
||
9 | { |
||
10 | use HasFactory; |
||
11 | |||
12 | protected $primaryKey = 'cust_file_id'; |
||
13 | protected $guarded = ['cust_file_id', 'created_at', 'updated_at']; |
||
14 | protected $hidden = ['cust_id', 'file_type_id', 'created_at', 'user_id']; |
||
15 | protected $appends = ['uploaded_by', 'file_type']; |
||
16 | protected $casts = [ |
||
17 | 'created_at' => 'datetime:M d, Y', |
||
18 | 'updated_at' => 'datetime:M d, Y', |
||
19 | 'shared' => 'boolean', |
||
20 | ]; |
||
21 | |||
22 | |||
23 | public function FileUpload() |
||
24 | { |
||
25 | return $this->hasOne(FileUploads::class, 'file_id', 'file_id'); |
||
26 | } |
||
27 | |||
28 | public function getUploadedByAttribute() |
||
29 | { |
||
30 | return User::find($this->user_id)->full_name; |
||
31 | } |
||
32 | |||
33 | public function getFileTypeAttribute() |
||
36 | } |
||
37 | } |
||
38 |