summaryrefslogtreecommitdiff
path: root/src/Models/NewsComment.php
diff options
context:
space:
mode:
authorMichael Weimann <mail@michael-weimann.eu>2019-11-12 21:49:43 +0100
committerMichael Weimann <mail@michael-weimann.eu>2019-11-12 21:58:40 +0100
commit26b8d2b92190de6ce4bbf6ccbb3f1a4f1a735d1d (patch)
treea4fc97930e7f1c309cc90e53c29700b12ede58d7 /src/Models/NewsComment.php
parentc0bf0b56f1359025d4bd95f7480c45aed6ad9c9a (diff)
Introduce the NewsComments model
Diffstat (limited to 'src/Models/NewsComment.php')
-rw-r--r--src/Models/NewsComment.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/Models/NewsComment.php b/src/Models/NewsComment.php
new file mode 100644
index 00000000..aed1926a
--- /dev/null
+++ b/src/Models/NewsComment.php
@@ -0,0 +1,47 @@
+<?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|LogEntry[] whereId($value)
+ * @method static QueryBuilder|LogEntry[] whereText($value)
+ * @method static QueryBuilder|LogEntry[] whereCreatedAt($value)
+ * @method static QueryBuilder|LogEntry[] 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);
+ }
+}