| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class Comment extends Model |
||
| 11 | { |
||
| 12 | use SoftDeletes, HasRevisions; |
||
| 13 | |||
| 14 | protected $table = 'uploadfile_comments'; |
||
| 15 | |||
| 16 | protected $fillable = [ |
||
| 17 | 'comment', |
||
| 18 | 'posted_by', |
||
| 19 | 'file_id', |
||
| 20 | ]; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Prepare a date for array / JSON serialization. |
||
| 24 | * |
||
| 25 | * @param \DateTimeInterface $date |
||
| 26 | * @return string |
||
| 27 | */ |
||
| 28 | 26 | protected function serializeDate(\DateTimeInterface $date) |
|
| 29 | { |
||
| 30 | 26 | return $date->format('Y-m-d H:i:s'); |
|
| 31 | } |
||
| 32 | |||
| 33 | 33 | public function getPostedByAttribute($postedById) |
|
| 34 | { |
||
| 35 | 33 | return app()->make(UserRepository::class)->getById($postedById); |
|
| 36 | } |
||
| 37 | |||
| 38 | 31 | public function file() |
|
| 41 | } |
||
| 42 | |||
| 43 | } |
||
| 44 |