This commit is contained in:
2026-08-15 13:37:07 +03:30
commit ed719317f3
76 changed files with 14009 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Comment
*
* @property int $id
* @property int $user_id
* @property int $commentable_id
* @property string $commentable_type
* @property string $body
* @property int $status
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property User $user
* @property Comment $comment
* @property Collection|Comment[] $comments
*
* @package App\Models
*/
class Comment extends Model
{
protected $table = 'comments';
public static $snakeAttributes = false;
protected $casts = [
'user_id' => 'int',
'commentable_id' => 'int',
'status' => 'int'
];
protected $fillable = [
'user_id',
'commentable_id',
'commentable_type',
'body',
'status'
];
public function user()
{
return $this->belongsTo(User::class);
}
public function comment()
{
return $this->belongsTo(Comment::class, 'commentable_id');
}
public function comments()
{
return $this->hasMany(Comment::class, 'commentable_id');
}
}