2019-11-12 21:49:43 +01:00
|
|
|
<?php
|
2019-11-12 22:04:39 +01:00
|
|
|
|
2019-11-12 21:49:43 +01:00
|
|
|
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
|
|
|
|
*
|
2019-12-01 01:32:20 +01:00
|
|
|
* @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)
|
2019-11-12 21:49:43 +01:00
|
|
|
*/
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|