summaryrefslogtreecommitdiff
path: root/src/Models/NewsComment.php
blob: 447d980feea0926856a4e563ba6b161f02e4c8eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php

declare(strict_types=1);

namespace Engelsystem\Models;

use Carbon\Carbon;
use Engelsystem\Models\User\UsesUserModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Query\Builder as QueryBuilder;

/**
 * This class represents a news comment.
 *
 * @property int         $id
 * @property int         $news_id
 * @property string      $text
 * @property News        $news
 * @property Carbon|null $created_at
 * @property Carbon|null $updated_at
 *
 * @method static QueryBuilder|NewsComment[] whereId($value)
 * @method static QueryBuilder|NewsComment[] whereNewsId($value)
 * @method static QueryBuilder|NewsComment[] whereText($value)
 * @method static QueryBuilder|NewsComment[] whereCreatedAt($value)
 * @method static QueryBuilder|NewsComment[] whereUpdatedAt($value)
 */
class NewsComment extends BaseModel
{
    use UsesUserModel;

    /** @var bool Enable timestamps */
    public $timestamps = true;

    /** @var string[] */
    protected $fillable = [
        'news_id',
        'text',
        'user_id',
    ];

    /**
     * @return BelongsTo
     */
    public function news(): BelongsTo
    {
        return $this->belongsTo(News::class);
    }
}