bristol-su /
upload-file
| 1 | <?php |
||
| 2 | |||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 3 | namespace BristolSU\Module\UploadFile\Models; |
||
| 4 | |||
| 5 | use BristolSU\ControlDB\Contracts\Repositories\User as UserRepository; |
||
| 6 | use BristolSU\Support\Revision\HasRevisions; |
||
| 7 | use Illuminate\Database\Eloquent\Model; |
||
| 8 | use Illuminate\Database\Eloquent\SoftDeletes; |
||
| 9 | |||
| 10 | class Comment extends Model |
||
|
0 ignored issues
–
show
|
|||
| 11 | { |
||
| 12 | use SoftDeletes, HasRevisions; |
||
|
0 ignored issues
–
show
The trait
BristolSU\Support\Revision\HasRevisions requires some properties which are not provided by BristolSU\Module\UploadFile\Models\Comment: $revisionNullString, $revisionEnabled, $revisionFormattedFields, $keepRevisionOf, $revisionUnknownString, $revisionFormattedFieldNames, $revisionCreationsEnabled, $softDelete
Loading history...
|
|||
| 13 | |||
| 14 | protected $table = 'uploadfile_comments'; |
||
| 15 | |||
| 16 | protected $fillable = [ |
||
| 17 | 'comment', |
||
| 18 | 'posted_by', |
||
| 19 | 'file_id', |
||
| 20 | ]; |
||
| 21 | |||
| 22 | 33 | public function getPostedByAttribute($postedById) |
|
|
0 ignored issues
–
show
|
|||
| 23 | { |
||
| 24 | 33 | return app()->make(UserRepository::class)->getById($postedById); |
|
| 25 | } |
||
| 26 | |||
| 27 | 31 | public function file() |
|
|
0 ignored issues
–
show
|
|||
| 28 | { |
||
| 29 | 31 | return $this->belongsTo(File::class); |
|
| 30 | } |
||
| 31 | |||
| 32 | } |